Welcome to Folder Explorer, a sleek Python-based desktop app built with Tkinter and ttkbootstrap to make browsing your filesystem a breeze. Whether you’re digging through project folders, organizing files, or just curious about what’s hiding in your directories, this tool offers an intuitive GUI to navigate, open, copy, and delete files with ease. It’s my personal solution to those moments when clicking through folders feels like a treasure hunt gone wrong! 😄
- Interactive Tree View: Displays folders (📁) and files (📄) in a clean, expandable tree, sorted with directories first.
- Lazy Loading: Loads subdirectories on-demand for snappy performance, even with large folders.
- Smart Navigation:
- Double-click to open files or folders in their default applications.
- Right-click for a context menu to open, copy paths, or delete items.
- Folder Memory: Saves your last selected folder in a
config.jsonfile to pick up where you left off. - Modern Styling: Uses ttkbootstrap’s “flatly” theme for a polished, professional look.
- Reset Option: Clear the view and start fresh with a single click.
- Cross-Platform Support: Works on Windows, macOS, and Linux with minimal tweaks (e.g.,
os.startfilefor Windows,startfilefor macOS). - Robust Error Handling: Gracefully handles permission errors, missing paths, and other issues with clear feedback.
- Python 3.6+: Ensure Python is installed. Download from [python.org](https://www.python.org/downloads/
- Dependencies:
-
tkinter: Included with Python. -
ttkbootstrap: For modern styling. -
Install dependencies via:
pip install ttkbootstrap
-
- Operating System: Tested on Windows, macOS, and Linux. File opening uses platform-specific commands (
startfilefor Windows,openfor macOS,xdg-openfor Linux).
-
Clone the Repository:
git clone https://github.com/theusmandev/Folder_Explorer.git cd folder-explorer -
Install Dependencies:
pip install ttkbootstrap
-
Run the Application:
python folder_explorer.py
Ensure the
folder_explorer.pyfile (rename your script accordingly) is in the project directory.
-
Launch the App: Run the script to open the GUI window titled “Folder Explorer”.
-
Select a Folder:
- Click “Select Folder” to browse and choose a directory.
- The last selected folder loads automatically on startup (stored in
folder_explorer_config.json). - The tree view displays contents, with folders first, followed by files.
-
Navigate and Interact:
- Expand Folders: Click the arrow next to a folder to load its contents (lazy loading keeps it fast).
- Open Items: Double-click a file or folder to open it in its default app (e.g., Notepad for
.txt, File Explorer for folders). - Context Menu: Right-click an item to:
- Open: Launch the file/folder.
- Copy Path: Copy the full path to your clipboard.
- Delete: Delete the file/folder after confirmation.
- Reset: Click “Reset” to clear the tree view and entry field.
-
Error Handling:
- Permission errors, missing paths, or other issues display as “❌ Permission Denied” or similar in the tree view.
- Pop-up messages provide details for actions like failed deletions or openings.
folder_explorer.py: Main script containing the GUI and logic for folder navigation.folder_explorer_config.json: Auto-generated file to store the last selected folder.images/:demo.gif(optional): Add a demo GIF or screenshot to showcase the app.
requirements.txt(optional): Create withpip freeze > requirements.txtfor easy dependency setup.
- GUI: Built with Tkinter and styled using ttkbootstrap’s “flatly” theme for a modern look.
- Tree View: Uses
ttk.Treeviewto display directories and files, with icons (📁/📄) and sorted order (dirs first). - Lazy Loading: Loads subdirectories only when expanded, reducing initial load time for large folders.
- Context Menu: Right-click menu offers quick actions (open, copy, delete) for selected items.
- Config File: Saves the last folder in a JSON file for persistence across sessions.
- Cross-Platform: Uses
os.startfile(Windows) oropen/xdg-open(macOS/Linux) for opening items, with robust error handling. - Error Management: Catches permission errors, file not found, and other exceptions, displaying user-friendly messages.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Make your changes (e.g., add a search bar, file previews, or drag-and-drop support).
- Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
Please ensure your code follows PEP 8 style guidelines and includes comments for clarity.
- Add a search bar to filter files and folders instantly.
- Display file metadata (e.g., size, modified date) in additional tree columns.
- Support file previews for images or text files.
- Enable drag-and-drop for moving or copying files.
- Add support for multiple themes via ttkbootstrap.
- Improve accessibility with keyboard shortcuts and screen reader compatibility.
- Large Directories: Lazy loading helps, but extremely large folders may cause slight delays. Consider optimizing with threading for future updates.
- Cross-Platform File Opening: Relies on
os.startfile(Windows) oropen/xdg-open(macOS/Linux), which may fail if the default app isn’t set. Fallbacks could be added. - Config File: If
folder_explorer_config.jsonbecomes corrupted, the app may fail to load the last folder. A reset clears it.
This project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by my frustration with slow file navigation and a love for Python GUIs.
- Thanks to the Tkinter, ttkbootstrap, and Python communities for their amazing resources.
- Shoutout to my late-night chai for keeping me going during debug sessions! ☕
Feel free to star ⭐ this repository if you find it useful, and share your feedback or ideas in the issues section!
Created by Muhammad Usman
