While the book is aimed at beginners and general office worker types, I think it can also help everyone who works in software too. Part 1 of the book is a general Python tutorial, but engineers can skip that and go to Part 2 which details several helpful modules.
Testers can benefit from Chapter 11 which covers web scraping and Selenium (good for testing web apps) and Chapter 18 which covers GUI automation (controlling the mouse & keyboard from Python) which can also be used for automated testing.
While it doesn't cover devop-specific modules like Celery or Fabric, devops and sysadmins can benefit from learning all the basic file operations (including how to compress and decompress files with Python's standard library) or providing email/SMS notifications.
Here's the table of contents:
Part 1 - The Basics of Python Programming
1. Python Basics
2. Flow Control
5. Dictionaries and Structuring Data
6. Manipulating Strings
Part 2 - Automating Tasks
7. Pattern Matching with Regular Expressions
8. Reading and Writing Files
9. Organizing Files
11. Web Scraping
12. Working with Excel Spreadsheets
13. Working with PDF and Word Documents
14. Working with CSV Files and JSON Data
15. Time, Scheduling Tasks, and Launching Programs
16. Sending Email and Text Messages
17. Manipulating Images
18. Controlling the Keyboard and Mouse with GUI Automation
But in general, I tried to write a programming book for beginners that skipped computer science. The "learn to code" mantra has become popular, but I asked myself, Why? What can people do once they can code that they couldn't before? I didn't like a lot of the usual answers given; they mostly seemed to be preying off of the fear that one wouldn't be technically savvy in a future that required it. But there are a lot of practical things you can do with programming knowledge, especially considering that even non-software engineers use computers for their job every day. So I started outlining what they could do.
Often this was mindless tasks where they'd have to open a PDF, copy and paste a line from it, and then do this for 400 PDFs. So data entry was one: with the sources or destinations being PDFs, Excel spreadsheets, text files, web sites, or Word documents. Doing data clean up is another: now they could write a script that used regex to make sure everything was formatted correctly, or use regexes to do find-and-replace operations. It'd be nice if they could have a script notify them by email or SMS text when some event happened. That's basically how the content of the book came together: what were the little things that a computer could do to help average people?
Automate the Boring Stuff with Python, a free book for beginners.
If you like the book (or even hate it), please write an Amazon review!
posted 4 years ago
Dear Albert Sweigart,
...While the book is aimed at beginners and general office worker types...
The niche you are addressing is a right target in its own since I think it has been neglected by other authors. As a software programmer I am sure I can benefit from reading your book as well. Right now Python has a great impact as an automation language for first class tools.
BTW I appreciate the effort you have made to make the book freely available under a Creative Commons license.
Can you shoot lasers out of your eyes? Don't look at this tiny ad: