DEV Community

12 8

Automating with Python | Creating and classifying files

Original post Automating with Python | Creating and classifying files

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
  • Move files
  • Randomize the content of the files
  • Zipping folders

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

The lesson

You have the code on my Github account. While it is easy to learn, I recommend you to watch the video where I explain what I'm doing on each line of the code and why.

And of course, remember to subscribe!


My Youtube tutorial videos

Final code on Github

Reach to me on Twitter

More tutorials on my blog

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup πŸš€

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

Top comments (0)

Image of PulumiUP 2025

Let's talk about the current state of cloud and IaC, platform engineering, and security.

Dive into the stories and experiences of innovators and experts, from Startup Founders to Industry Leaders at PulumiUP 2025.

Register Now

πŸ‘‹ Kindness is contagious

Value this insightful article and join the thriving DEV Community. Developers of every skill level are encouraged to contribute and expand our collective knowledge.

A simple β€œthank you” can uplift someone’s spirits. Leave your appreciation in the comments!

On DEV, exchanging expertise lightens our path and reinforces our bonds. Enjoyed the read? A quick note of thanks to the author means a lot.

Okay