This Program is used to generate the structure of a folder.. from root to end..
This is a simple Python application built using Tkinter that allows you to browse a folder and save its tree structure to a text file.
- Python 3.x
- Tkinter (usually included with Python)
- os (standard library)
- tkinter (standard library)
- Ensure you have Python installed. You can download it from python.org.
- Tkinter is usually included with Python. If not, you can install it using the following command:
sudo apt-get install python3-tk
- Run the script:
python Structure_generator.py
- Select a folder:
- Click on the "Browse" button to open a dialog box.
- Navigate to the folder you want to analyze and select it.
- Save the tree structure:
- Click on the "Save Tree Structure" button.
- Choose the location and name for the text file that will contain the tree structure.
browse_folder(): Opens a directory selection dialog and sets the selected folder path.save_tree_structure(): Generates the tree structure of the selected folder and saves it to a text file.get_tree_structure(folder): Recursively generates a tree structure of the specified folder.
The main window contains:
- An entry field to display the selected folder path.
- A "Browse" button to select a folder.
- A "Save Tree Structure" button to save the folder's tree structure to a text file.
The tree structure is saved in a format similar to:
├── folder_name/
├── subfolder1/
├── file1.txt
├── file2.txt
├── subfolder2/
├── file3.txt