Python Automation for Beginners: How to Eliminate Repetitive Tasks Fast
Master Python automation and learn how to save hours by automating repetitive tasks. Discover how to organize files, run scripts, and simplify your daily workflow.
Every day, most of us waste more time than we realize on small, repetitive tasks. I know for me, I rename files one at a time, move things into folders, delete old downloads, or send the same kinds of emails over and over.
These things seem harmless, but they quietly drain your time and focus. They don’t challenge you or add any real value to your work. Since starting my own business, I’ve been thinking a lot about this recently.
How can I optimize my time in the day, and utilize my best hours to become my most productive hours? A question I keep asking myself as most of my business is just me, with the help of my intern on certain tasks.
Every week you’ll be introduced to a new topic in Python, think of this as a mini starter course to get you going and allow you to have a structured roadmap that actually builds to create you a solid foundation in Python. Join us today!
The answer to this question for many of you is actually where Python automation can step in.
After learning the basics of Python on my Python Roadmap to Success, the next obvious question I got from some of my readers is: “Now what? How do I use these skills in practice?”
This will be the first article of a new series I’ve been working on, “Automating Your Life with Python.”
This is mean’t to build on The Python Roadmap to Success. It’s a hands-on, practical look at how you can use Python to handle the boring stuff so you can focus on what actually matters.
You don’t need to be a software engineer to do this. All you need is a little curiosity and a desire to take back your time.
So, let me officially kick this off with the most important question.
Thank you guys for allowing me to do work that I find meaningful. This is my full-time job so I hope you will support my work by joining as a premium reader today.
If you’re already a premium reader, thank you from the bottom of my heart! You can leave feedback and recommend topics and projects at the bottom of all my articles.
I’m launching my Live Python Cohort that starts early next month! You can register here - Join the Live Python Cohort (Only 20 Seats)
👉 I genuinely hope you get value from these articles, if you do, please help me out, leave it a ❤️, and share it with others who would enjoy this. Thank you so much!
Why bother automating things?
It’s a late night, near the holiday time in upper Manhatten. Two people are sitting in an office, both asked to rename 100 files to match a new format. The first person opens each file one by one, changes the name, and saves it. It takes forever.
The second person writes a short Python script, presses run, and the whole thing is done in seconds. That’s the difference between working hard and working smart.
Automation means letting the computer handle the boring, repetitive stuff so you can focus on the parts that actually need your brain. It’s not only about saving time, though that’s a huge benefit.
It’s also about being consistent and accurate. Computers don’t lose focus or make careless mistakes. Once you tell them exactly what to do, they’ll do it perfectly every time.
Python is perfect for this kind of work. It’s simple to learn, powerful to use, and comes with everything you need to start automating right out of the box. Let’s look at those tools next.
The Core Tools of Python Automation
Before you can start automating anything, you need to understand how Python communicates with your computer. One of the best things about Python is its built-in library that already has a set of ready-to-use tools and can handle almost anything you might want to automate.
There are four core modules you’ll use most often for everyday automation: os, shutil, subprocess, and time.
Those names might sound a little technical now, but don’t worry. By the end of this article, you’ll not only know what each one does, you’ll actually use them to build your first real automation script.
👉 I genuinely hope you get value from these articles, if you do, please help me out, leave it a ❤️, and share it with others who would enjoy this. Thank you so much!
1. The os Module: Talking to Your Operating System
Look, I preached Path the other day in an article. Honestly it’s great, it’s newer but still great. But with anyone who has just started learning or finished learning Python, os is inevitably a module you must know.
The os module is where most automation projects begin. It gives Python the ability to talk directly to your computer’s operating system. You can think of it as a bridge between your code and your computer’s file system.
For instance, if you want to see what files are in a specific folder, you can use os.listdir() like this:
This short script prints out every file and folder inside your Downloads directory while also converting them into a Python list for quick access. From there, you can go beyond just listing files as you can create, rename, or delete them directly through Python.
Creating a new folder takes just one line:
os.mkdir(”new_folder”)And renaming it is just as simple:
os.rename(”new_folder”, “organized_files”)With only a few lines of code, you’re now controlling your file system without ever touching your mouse. That’s the power of automation in its simplest form.
Finish with a Portfolio, Not Just Notes.
Most people get stuck before they even start… But that doesn’t have to be you!
The Python Masterclass is designed to take you from “I don’t know where to start” to “I can build real-world Python projects” — in only 12 weeks.
👉 I’m giving you my exact system that’s been proven and tested by over 1,500 students over the last 4+ years!
My live Python Cohort is designed so you see your first win in your first class — you’ll build your first working Python scripts in the first sessions and finish projects you can be proud of.
The sooner you start, the sooner you’ll have projects you can actually show to employers or clients.
Imagine where you’ll be 90 days from now if you start today.
👉 Ready to get started?
2. The shutil Module: Moving and Copying Files
Next up the shutil module now builds on what you can do with os, giving you more control over how files are handled. While os lets you see and manage folders, shutil focuses on moving, copying, and deleting files or entire directories.
Let’s just imagine your desktop is filled with screenshots, and you want to move all the .png files into a single folder called “Screenshots.” You can do that automatically with this script:
When you run this, every .png file on your desktop will be moved into the Screenshots folder in seconds. You can easily tweak this script to organize PDFs, Word documents, videos, or any other type of file.
It’s a small example, but it shows how a few lines of Python can save you from doing the same dull task over and over.
Automations like this quietly give you back hours every week! Read that back again, that’s right you could be saving hours, every single week.
👉 I genuinely hope you get value from these articles, if you do, please help me out, leave it a ❤️, and share it with others who would enjoy this. Thank you so much!
3. The subprocess Module: Running System Commands
Sometimes you’ll want Python to run a command the same way you would in your computer’s terminal. That’s exactly what the subprocess module is for. It lets your Python code execute system-level commands directly.
For example, if you wanted to check how much storage space you have left, you might normally type this into your terminal:
df -hYou can do the exact same thing inside Python with just a few lines:
This script runs the command and prints out the results right in your terminal window. You can use subprocess for much more than this, like opening programs, running shell scripts, or connecting several automation tasks together.
It’s a simple but strong enough way to make Python work hand in hand with your operating system.
👉 I genuinely hope you get value from these articles, if you do, please help me out, leave it a ❤️, and share it with others who would enjoy this. Thank you so much!
4. The time Module: Adding Delays and Scheduling Tasks
Finally, automation isn’t just about doing everything as fast as possible. Sometimes you need to add a short pause — maybe to wait for a file to finish downloading or to give another program a moment to respond before moving on.
That’s where the time module comes in. Yes, it’s super basic and simple as this is often a module I teach my students but really it lets you control timing inside your scripts.
Here’s a simple example:
This script pauses for five seconds before moving to the next line. On its own, it might not seem like much, but when you combine it with file operations or system commands, it becomes really useful.
You can use it to pace your automations and make sure everything runs smoothly in the right order.
👉 I genuinely hope you get value from these articles, if you do, please help me out, leave it a ❤️, and share it with others who would enjoy this. Thank you so much!
Your First Automation Script: Organizing Files
Let’s put what you’ve learned into action with a small project that actually solves a real problem.
Most people’s Downloads folder ends up looking like a digital junk drawer, at least mine does. I have countless old PDFs, images, zip files, and random things that have piled up over time. I can just clean it up in seconds with a quick Python script.
Here’s one that automatically sorts your files into folders based on their type:
When you run this, Python scans your Downloads folder, figures out what kind of file each one is, and moves it into the right subfolder all on its own.
You can expand this by adding more categories or set it to run automatically every day using a task scheduler like macOS Automator, Windows Task Scheduler, or cron on Linux.
This is what automation is all about. It’s about spotting something repetitive, turning it into a repeatable rule, and letting your computer take care of it from now on.
The Thought Process Behind Automation
The code above gets the job done, but real automation isn’t just about writing scripts but rather about how you think. You’re not simply coding, you’re teaching your computer to act as your assistant.
Ask yourself, “What exactly am I doing here?” Write out those steps in plain English before you ever touch your code. Then, translate each step into Python. For example, if one of your steps says, “Move all .png files into a folder,” that can become a simple loop in Python that checks file types and moves them automatically.
Start small. Use print statements to test what your script is doing before letting it make real changes. This helps you understand its behavior and prevents mistakes.
And don’t feel like you have to automate everything at once. Pick one process, make it work smoothly, and then build from there.
Automation isn’t just a technical skill — it’s a mindset. Once you start seeing your daily routines as a series of steps that can be defined and repeated, you’ll begin to notice opportunities for automation almost everywhere.
👉 My Python Learning Resources
Here are the best resources I have to offer to get you started with Python no matter your background! Check these out as they’re bound to maximize your growth in the field.
Zero to Knowing: My Python Masterclass Subscription gives you everything you need to go from zero to building real-world projects — with new lessons, challenges, and support every month. Over 1,500+ students have already used this exact system to learn faster, stay motivated, and actually finish what they start.
P.S - Save 20% off your first month. Use code: save20now at checkout!
Code with Josh: This is my YouTube channel where I post videos every week designed to help break things down and help you grow.
My Books: Maybe you’re looking to get a bit more advanced in Python. I’ve written 3 books to help with that, from Data Analytics, to SQL all the way to Machine Learning.
My Favorite Books on Amazon:
Python Crash Course - Here
Automate the Boring Stuff - Here
Data Structures and Algorithms in Python - Here
Python Pocket Reference - Here
Wrapping it up
Automation isn’t about doing less — it’s about doing smarter work. It’s a way to hand off the repetitive, routine stuff so you can spend your time on things that actually matter.
Python makes that possible. It connects human thinking with machine power. With just a few lines of code, you can turn your computer into an assistant that quietly handles the little chores that eat away at your day.
Start small. Write one simple script and see it run. Then do another one tomorrow. Over time, you’ll notice how much lighter your workload feels. Automation isn’t just about saving time — it’s about giving yourself more freedom to think, create, and focus.
This is just the beginning of the Automating Your Life with Python series. In the next part, we’ll go deeper into automating your file system by building scripts that can monitor, move, and organize your data on their own.
Your computer’s ready. Python’s ready. The only question left is, are you ready to stop doing the same things twice?
Hope you all have an amazing week nerds ~ Josh (Chief Nerd Officer 🤓)
👉 If you’ve been enjoying these lessons, consider subscribing to the premium version. You’ll get full access to all my past and future articles, all the code examples, extra Python projects, and more.









