DEV Community

David MM👨🏻‍💻
David MM👨🏻‍💻

Posted on

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

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay