A Python-based GUI file management application that simplifies the process of navigating, organizing, and managing files and directories. Built using customtkinter
for a modern interface, this tool is ideal for users looking for an intuitive and efficient way to handle everyday file operations.
- Features
- Screenshots
- Installation
- Usage
- Dependencies
- Code Structure
- Error Handling
- Contributing
- License
- Navigation: Easily browse through directories and open files with a double-click.
- Quick Access: Access common folders like Documents, Videos, Pictures, and Downloads instantly.
- File Operations: Perform basic file operations including renaming, moving, copying, and deleting files or directories.
- Search Functionality: Quickly find files or folders within a directory and its subdirectories.
- Dynamic Path Display: Keep track of the current working directory as you navigate.
- Customizable User Interface: Modern dark-themed UI using
customtkinter
for a visually appealing user experience. - Zip Functionality: Select multiple files and directories to compress into a ZIP file.
The main interface of the Python File Manager showing the directory navigation, quick access panel, and file operations.
To set up the File Manager on your local machine, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/python-file-manager.git cd python-file-manager
-
Install the required dependencies:
pip install send2trash customtkinter
pip install -r requirements.txt
-
Run the application:
python "File Manager v6.py"
- Navigate: Double-click on items in the list to navigate into directories or open files.
- Quick Access: Double-click on common locations in the left panel for instant access.
- File Operations:
- Select an item and click on "Open" to open it.
- Click on "Rename" to change the name of the selected item.
- Click on "Move" or "Copy" to move or copy the selected item to another directory.
- Click on "Delete" to remove the selected item.
- Search: Click on "Search" to look for files or folders by name within the current directory and subdirectories.
- Zip: Select multiple items and click on "Zip" to compress them into a ZIP file.
- Back: Use the "Back" button to navigate to the parent directory.
- Add to Quick Access: Select a directory and click "Add to Quick Access" for easier future navigation.
The following Python libraries are used in this project:
os
: For interacting with the operating system and managing files.shutil
: To perform high-level file operations like moving and copying.send2trash
: To safely send files to the trash instead of permanently deleting them.customtkinter
: For building a modern-looking graphical user interface.tkinter
: For creating dialogs, message boxes, and basic widgets.psutil
: To detect and list available drives on the system.
Install all dependencies with:
pip install -r requirements.txt
The core of the application is encapsulated within the FileManager
class, which extends ctk.CTk
. Here's a breakdown of its key methods:
__init__(self)
: Initializes the main window, sets up the appearance, and defines common locations.create_widgets(self)
: Sets up the UI components like frames, listboxes, and buttons.populate_listbox(self)
: Lists all files and folders in the current directory.on_location_selected(self, event)
: Handles double-clicks on the location list to navigate to selected directories.open_item(self)
: Opens files or navigates into folders.rename_item(self)
: Prompts for a new name and renames the selected item.delete_item(self)
: Deletes files or folders after user confirmation.zip_item(self)
: Compresses selected files or directories into a ZIP archive.
For more details, refer to the source code.
- PermissionError: Displays a user-friendly error message if access to a directory is denied.
- File Operations: Confirms with the user before performing critical actions like deletion to prevent accidental data loss.
- No Selection Warnings: Alerts the user if no item is selected when attempting to perform operations like renaming or zipping.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Push to the branch.
- Open a pull request.
Please ensure your code follows the established style and includes proper documentation.
This project is licensed under the MIT License. See the LICENSE
file for more details.