If you want to become more productive, 'Automate the Boring Stuff with Python' is the place to start
[See the end of this article for an update.]
"Don’t spend your time doing work a well-trained monkey could do. Even if you’ve never written a line of code, you can make your computer do the grunt work." - Al Sweigart, author of Automate the Boring Stuff with Python
Sweigart's right, most computer users do far more drudge work than they need to simply because they don’t know how to automate what they do.
The trouble is that most automation tools aren’t that easy to use. Batch files, for example, are okay for really simple tasks but it takes serious effort and skill to create batch files that do anything even slightly complicated without bombing. What about using programming languages? Does learning a programming language make the task easier? That’s debatable. For most people, I’d say not. Indeed, I’d go further and say that given most users’ general lack of understanding of computers, providing Joe Fatfingers with any kind of automation or programming tools is akin to giving a teenager the keys to a Ferrari … no good can come of it and disaster will be, literally, just around the corner.
On the other hand for more skilled users, teaching them how to program and giving them effective tools has, potentially, enormous value. But what tools to give them?
I have become a big fan of the Python language due to its elegance and power and that’s why Sweigart argues it's a good vehicle for teaching programming and, specifically, a great way to automate the boring stuff.
Part I of Automate the Boring Stuff with Python is pretty much a standard introduction to Python covering the interactive shell, data types, string operations, flow control, function, lists and list operations, and so on. Even if you think you have a pretty good grasp of Python, unless you’re a seasoned Python programmer, you’ll probably get a lot out reviewing the fundamentals a la Sweigart; his writing is clear and considerably easier to follow than the more geeky Python tomes. Each chapter also includes a practice questions section so you can check your understanding.
Part I ends with two projects, the first to create a simple (i.e. insecure) password locker which demonstrates stuffing the clipboard and the second, a program to add bullets to wiki markup stored in the clipboard.
Part II focuses on automating tasks and begins with a primer on our old friend, regular expressions which leads to a project to extract phone numbers and email addresses from text stored in the clipboard. After that come projects that demonstrate file operations; creating archives using ZIP compression; web scraping and controlling browsers; manipulating Excel spreadsheets, PDF files, Word, CSV, and JSON documents; keeping time; scheduling tasks; launching programs; sending email and text messages; manipulating images; and controlling the keyboard and mouse.
Some of the projects will be immediately useful while others will be more like stepping stones to building customized programs specific to your own workflow. What this book does really well is to give you the foundational techniques for doing useful automation. It also provides clear examples of Python code that you might not find elsewhere. For example, just before reading the book I had been wrestling with the BeautifulSoup library for extracting data from HTML and XML content. Automate the Boring Stuff with Python has a project that uses this library and the explanation of how to use BeautifulSoup solved my problem (or, more accurately, solved my misunderstanding).
So, do you need Automate the Boring Stuff with Python? Yes, if you want to enhance your workflow by using automation, this is an excellent place to start. Automate the Boring Stuff with Python is from No Starch Press priced at $29.95 for a print version with a free PDF version, or $23.95 for the ebook version (PDF, Mobi, and ePub). Highly recommended.
UPDATE: Sweigart has created a special discounted offer for Network World readers to take his online "Automate the Boring Stuff with Python Programming" course via Udemy.
Inside the Amazon Dash Button hack and how to make it usefulNext Post
Perdemia's Permission Analyzer: How to find out who can get access to what on your network
Microsoft's Project Spark is dead, not just resting.
Red Hat expands its partnership with Ericsson to focus on OpenStack, NFV infrastructure,...
By forcing Windows 10 on users, Microsoft has lost the tenuous trust and credibility users had in the...
Among Gartner's 10 predictions for the near term are a fast move to augmented reality, the decline of...
The goal of security awareness training is to help employees recognize and avoid security risks. The...
What every citizen should know about the state of our voting systems and the security of our elections....
Top CIOs bank millions in cash, equity, extras