Automating with Python | Creating and classifying files

Опубликовано: 08 Март 2025
на канале: Let's Learn About
793
7

Websites, Machine Learning, REST APIs... Professional Python has a lot of uses. But Python can also help us with mundane tasks, for example, automating repetitive tasks.

On the first part of the video, we are going to generate randomized students reports, containing random names, subjects, date of file creation, subjects and marks. And also how to delete only the .txt files generated to clean our folder.

On the second one, we are going to read the files, count how many failed subjects the student has, rename the file by adding it passed or failed, moving the file to a 'passed' or 'failed' folder, and then zipping both folders into .zip files

In this video you’ll learn how to:

Create files
Read files
Delete files
Rename files
Move files
Randomize the content of the files
Zipping folders
Passing down arguments to the script

and more. With just using Python, no packages nor modules needed.

╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬

00:47 - First script: The files generator
01:42 - Processing files with Python
02:28 - Passing arguments when running a script
03:54 - Generating reports | An explanation
06:27 - How to use zfill
07:54 - Creating files in Python with 'with open'
08:20 - Shuffling elements in a list
12:05 - Creating the file's text.
13:22 - Deleting files
14:13 - Second script: The classifier one
14:43 - Processing the reports
14:54 - Generating folders
15:20 - Reading all the files
16:18 - Checking if a student has passed or failed
18:28 - Moving and renaming files
20:14 - Zipping files
20:35 - Conclusion

╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬

Reading files with Python:
https://docs.python.org/3/tutorial/in...

High-level operations:
https://docs.python.org/3/library/shu...

╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬

Subscribe to the channel:
   / @letslearnabout4934  

Text version:
https://letslearnabout.net/tutorial/a...

Twitter:
  / davidmm1707  

GitHub:
https://github.com/david1707/auto_tea...