Transform Your Life: Learn Automation with Python to Thrive
Written on
Chapter 1: The Shift Toward Automation
In today's world, many jobs involve repetitive tasks that are often seen as tedious and undesirable. With the rise of advanced AI, not only are tasks being automated, but entire positions are at risk of being replaced. Recognizing this trend, I decided a few years ago to start automating simple tasks, even without prior coding experience.
Learning to automate tasks can be one of the most effective ways to grasp a programming language. Like the satisfaction of playing your first song on an instrument or holding a conversation in a new language, automation offers a rewarding experience that keeps you motivated, even through the challenges of mastering a new skill.
Instead of dedicating countless hours to coding, I discovered that I could begin automating tasks almost immediately. This approach allowed me to get acquainted with a programming language like Python. I began by mastering the basics and applying them to streamline various monotonous tasks at work.
But my journey didn't end there! I extended my automation efforts to my home life as well. By letting machines handle time-consuming chores, I freed up my schedule to focus on what truly matters.
Here are some of the simple yet impactful aspects of my life that I automated with Python, which can help you start your own automation journey.
Section 1.1: Automating My Morning News
Although I’m not a huge fan of reading the news, I often check the sports section while having breakfast. However, today’s news websites can be incredibly distracting. You might start reading one article but end up sidetracked by ads or video content instead.
To tackle this, I utilized a Python web automation library called Selenium. This allowed me to extract the headline, subtitle, and link of the news articles from my preferred website, effectively converting it into a simple text format that’s free of distractions.
I scheduled the script to run each morning, enabling Selenium to open the website and create a straightforward text file with the news headlines.
This raw data allows me to focus on the content, and when something piques my interest, I can click through directly to the article.
Section 1.2: Streamlining Email Communication
One of the most time-consuming tasks in many office jobs is dealing with emails. Often, reading and responding to them adds little value to our work. To alleviate this, I automated the process of sending daily emails containing product status updates or reports needed by vendors.
While not every email can be automated due to the need for personalization, Python can definitely help with repetitive messages that follow a specific format. Although I no longer have access to my work email, here’s an example of an automated email I sent to myself.
These automated emails can include text, attachments, and much more.
Chapter 2: Mastering Excel Automation
Excel is widely used for reporting, yet it lacks robust automation features. While tools like VBA and Power Query are available, they only work within Microsoft Office applications. For more complex needs, I found that Python provided the versatility I required.
Using the openpyxl library, I could read and write Excel files, create new workbooks, and manipulate worksheets just as I would manually in Excel. Here’s a pivot table and bar chart I generated using openpyxl along with the pandas library.
The power of Python lies in its vast array of libraries; if one doesn’t meet your needs, there’s likely another that will.
Chapter 3: Scheduling Messages on WhatsApp
Have you ever forgotten to send a birthday message to a friend? That happened to me frequently—until I learned Python. There are several libraries available for automating WhatsApp messages, including pywhatkit, which streamlines the entire process.
While using Selenium is the more complex and time-consuming option, it allows for automation across various websites. In contrast, pywhatkit is specialized for WhatsApp and can get the job done quickly, albeit without the depth of learning.
Here’s an example of a WhatsApp message I sent through Python.
Chapter 4: Automating Online Dating
Online dating can be a tedious endeavor, often consuming hours of swiping without yielding many results. To streamline this process, I turned to Selenium to automate swiping on platforms like Tinder, which has a web version.
This was one of my more challenging automation projects due to Tinder's two-step verification process, but I managed to find workarounds to keep the task semi-automated.
By running the program every 12 hours, I maximized the number of free swipes I could use.
In conclusion, learning to automate your life with a programming language like Python can help you stay relevant in a world where automation is becoming increasingly prevalent.
For more insights, check out the following videos:
This video, titled "Automating My Life with Python: The Ultimate Guide | Code With Me," dives deeper into the various ways to leverage Python for automation.
In "How I Automate My Life as a Software Engineer," you'll discover practical examples of automation in a software development context.
Join my email list of over 10,000 subscribers to receive my FREE Automation Cheat Sheet!