File Management Tutorial in Python - Beginners | Python Automation Projects

preview_player
Показать описание
The best way to learn Python and improve your Python skills is to apply them. However, it can get boring and and tedious if you solve "traditional" programming problems usually taught in bootcamps or university. Instead, the most fun way to learn is to build projects!

With the power of Python, you can automate repetitive tasks and save valuable time. Join me in this new series on Python Automation Projects as we dive deep into the world of Python, exploring various techniques, libraries, and best practices.

In this video, I show you guys how to build a File management script in Python. The script monitors the downloads folder and moves files to folders of your choice depending on the content type of the file. It can save you time as you don't have to manually move files and clean up the Downloads folder.

The project is especially suited to beginners and shows how to use external libraries and the technique of starting out with quickstart code and then building on that to achieve the desired outcome.

GitHub Link to Code:

WatchDog library pip install:

WatchDog library documentation:

00:00 Intro
01:03 Watchdog QuickStart code
02:04 Demo watchdog
02:48 Overview of events in watchdog documentation
03:40 Setting folder paths
04:07 Implement FileSystem event handler & override oncreate
05:18 Instantiate DownloadHandler object
05:31 Get file path
05:43 Python mimetypes
07:46 Implement move_file method
08:53 Shutil library
09:26 f strings in Python
10:32 mkdir to create directories
11:07 Demo Time!
12:26 Wrap-up

Please consider liking if you found the video useful and subscribe for more!

Рекомендации по теме
Комментарии
Автор

Hi It was really nice, may be it is good to create a binary and run as systemd service in case of linux

omkarkhatavkar
join shbcf.ru