Automate the Boring Stuff With Python
- NI recently added Python Integration to both LabVIEW and TestStand.
- Danielle Jobe’s presentation at GDevCon last year and her hands-on at NI week this year were both on integrating LabVIEW and Python.
- I had a job this year where there was potential for more work to be done but they decided to use Python instead of LabVIEW.
- I manage several servers for my business where Python could come in handy.
- I have an interest in cybersecurity where Python is increasingly one of the tools of choice.
- As a business owner, I do lots of repetitive tasks that could very easily be scripted. LabVIEW is an option but probably overkill for most of the stuff I want to do. Also, I use Linux a lot so that kind of rules out LabVIEW (I know technically you can do it). Bash is ok, but it would be nice to have something more powerful.
For all these reasons I decided that perhaps I should learn some Python. I happen to have read some No Starch Press books in the past and really liked them, so I picked up a copy of Automate the Boring Stuff with Python by Al Sweigart.
I am kind of a computer science nerd. The first thing I will say is that this is not a computer science book. It covers just enough computer science to get you up and running. This is more of a practical hacker book. Its target audience is someone with very little programming experience who wants to automate some common repetitive tasks. The focus of the book is on office type automation.
Some of the topics include manipulating excel spreadsheets, word docs, and pdfs, web scraping and form filling using Selenium, sending emails and texts, manipulating images, renaming and moving files, scheduling tasks, and some GUI automation using PyAutoGUI. Overall, there is some useful stuff here. The exercises give some ideas on how to expand things. It teaches you just enough programming to be dangerous.
I found it a good starting point to learn Python. Learning a new programming language from a computer science book can be boring and slow going. This was fast-paced and entertaining. It gets you up and doing useful stuff pretty quickly. It doesn’t really cover OOP or other advanced topics, so obviously it is only just a starting point, but it is a very good one and I highly recommend it.