File Management Tutorial in Python - Beginners | Python Automation Projects

Published: 05 June 2023
on channel: Haseeb Kamal
455
14

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:
https://gist.github.com/mhkamal1/49b8...

WatchDog library pip install:
https://pypi.org/project/watchdog/

WatchDog library documentation:
https://pythonhosted.org/watchdog/

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!

Subscribe here:    / @haseebkamal  


On this page of the site you can watch the video online File Management Tutorial in Python - Beginners | Python Automation Projects with a duration of hours minute second in good quality, which was uploaded by the user Haseeb Kamal 05 June 2023, share the link with friends and acquaintances, this video has already been watched 455 times on youtube and it was liked by 14 viewers. Enjoy your viewing!