This Python script automates the creation of a personalized weekly log folder β saving you time by generating structured daily task files in just a few seconds. It's a beginner-friendly project that bridges the gap between Python basics and real-world file management.
- Python 3 β The core programming language powering the entire script
osmodule β A built-in Python library used to interact with the operating system, handle folder creation, check paths, and build file paths in a cross-platform way- File I/O (
open,write) β Python's built-in file handling system used to create and write content into.txtfiles input()function β Python's standard way to capture real-time input from the user in the terminal
- Custom Folder Creation β Prompts the user to name their own folder; creates it only if it doesn't already exist (no accidental overwrites)
- Automated File Generation β Automatically creates 5
.txtfiles, one for each weekday (Monday through Friday) - Personalized Content β Asks the user for a unique task entry for each day and writes it directly into that day's file
- Structured Format β Each file is pre-formatted with a header and a task label for clean, readable output
- Success Feedback β Prints confirmation messages in the terminal after each file is saved and a final success message when all files are done
- User inputs a folder name β The script uses
input()to ask for a folder name and stores it infolder_name - Folder existence check β
os.path.exists()checks if the folder already exists; if not,os.makedirs()creates it - Day list is defined β A hardcoded list of weekday names (
["Monday", ..., "Friday"]) is set up for iteration - Loop runs for each day β A
forloop iterates over each day in the list - File path is built β
os.path.join()combines the folder name and day name to create a proper file path - User enters a task β
input()prompts the user for their main task for that specific day - File is created and written β Python opens the file in write mode (
"w") and writes a formatted header along with the user's task - Confirmation is printed β A success message appears in the terminal for each file created
- Final message displayed β Once the loop finishes, a completion message confirms all 5 files were generated
- How to use Python's
osmodule to interact with the file system β creating folders, checking paths, and joining directory names safely - How to combine user input, loops, and file I/O to build a small but fully functional automation tool from scratch
This project demonstrates how even a short Python script can automate repetitive tasks and produce real, usable output. It's a solid foundation for anyone learning Python who wants to go beyond theory and build something practical.