Skip to content

A modern GUI Folder Explorer built with Python. It supports dynamic directory expansion (lazy loading), right-click context menus for file operations, and automatically restores your last viewed directory upon startup.

Notifications You must be signed in to change notification settings

theusmandev/Folder_Explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Folder Explorer: A Python-Powered File Navigator 📂

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! 😄

Features

  • 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.json file 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.startfile for Windows, startfile for macOS).
  • Robust Error Handling: Gracefully handles permission errors, missing paths, and other issues with clear feedback.

Demo

Folder Explorer Demo

Prerequisites

  • 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 (startfile for Windows, open for macOS, xdg-open for Linux).

Installation

  1. Clone the Repository:

    git clone https://github.com/theusmandev/Folder_Explorer.git
    cd folder-explorer
  2. Install Dependencies:

    pip install ttkbootstrap
  3. Run the Application:

    python folder_explorer.py

    Ensure the folder_explorer.py file (rename your script accordingly) is in the project directory.

Usage

  1. Launch the App: Run the script to open the GUI window titled “Folder Explorer”.

  2. 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.
  3. 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.
  4. 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.

Project Structure

  • 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 with pip freeze > requirements.txt for easy dependency setup.

How It Works

  • GUI: Built with Tkinter and styled using ttkbootstrap’s “flatly” theme for a modern look.
  • Tree View: Uses ttk.Treeview to 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) or open/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.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes (e.g., add a search bar, file previews, or drag-and-drop support).
  4. Commit your changes (git commit -m "Add your feature").
  5. Push to the branch (git push origin feature/your-feature).
  6. Open a pull request.

Please ensure your code follows PEP 8 style guidelines and includes comments for clarity.

Future Enhancements

  • 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.

Known Issues

  • 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) or open/xdg-open (macOS/Linux), which may fail if the default app isn’t set. Fallbacks could be added.
  • Config File: If folder_explorer_config.json becomes corrupted, the app may fail to load the last folder. A reset clears it.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • 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

About

A modern GUI Folder Explorer built with Python. It supports dynamic directory expansion (lazy loading), right-click context menus for file operations, and automatically restores your last viewed directory upon startup.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages