8 ms·
Automate the Boring Stuff with Python
- makmanalp 12y agoThis is very cool! I think this'd be a great incentive for people to learn programming and a great way to get into it - I know I've gotten a few folks to look into it purely by showing them how much easier life can be when you automate things. And people are more motivated to learn when something is solving real problems for them.
- patrickyeon 12y agoLooks interesting. It sounds like it will attack a lot of the first things I did actual (non-homework, non-toy) programing for, which are also things I've tried (unsuccessfully) to convince others to learn just a bit of programming to be able to do. I hope this book accomplishes that.
- akilism 12y agoThis is kind of how I got my girlfriend interested in programming. She was killing herself at work doing stuff manually with QGIS that could be automated with python.
- 650REDHAIR 12y agoLooks great! Was pretty bummed when I saw the April 25th release.
- Splendor 12y agoE-books are available now at http://www.nostarch.com/automatestuff http://www.nostarch.com/automatestuff
- sciencesama 12y agobut we cant download it unless we buy the physical copy !!
- Splendor 12y agoI'm not sure where you're seeing that. I see an option to buy the e-book only for $23.95 and the page has red text that reads "Full PDF, ePub, and mobi ebooks now available!". Am I missing something you see on the page?
- adamnemecek 12y agoYou can get a 30% discount http://inventwithpython.com/blog/2015/04/21/celebrating-the-release-of-automate-the-boring-stuff-with-python-with-discount-codes/ http://inventwithpython.com/blog/2015/04/21/celebrating-the-...
- AlSweigart 12y agoAuthor here. The 30% discount code is PYBUTLER, which you use on the No Starch Press site: http://nostarch.com/automatestuff http://nostarch.com/automatestuff
- deleted 12y ago[deleted]
- hayd 12y ago> His books are freely available under a Creative Commons license... So perhaps they will be available for free from April 25th?
- amykhar 12y agoHe posted somewhere that the free html version is almost complete and will be released in a few days.
- AlSweigart 12y agoAuthor here. Yes, I can confirm that if you order the ebook now you will get the full ebook. The physical books have also been printed, so they'll probably get shipped before the 25th (don't quote me on that).
- shenanigoat 12y agoI'm very interested in this book. However, the author leaves no way for me to be updated when it's released. I have to bookmark the page and check later if I remember. For a book on automating, that's asking a lot of me. ;)
- Splendor 12y agoYou can order at No Starch Press: http://www.nostarch.com/automatestuff http://www.nostarch.com/automatestuff
- AlSweigart 12y agoYou can order it now from the No Starch Press site, using code PYBUTLER for a 30% discount: http://www.nostarch.com/automatestuff http://www.nostarch.com/automatestuff You'll get the full PDF/epub/mobi version immediately, and the print book will be shipped soonish. (Or maybe immediately. They've come in from the printer and I have my author copies.)
- Innistrad 12y agoI'm not sure if this is a weekly release of a topic or a total release on April 25th. Wish there was a way to get in touch with the author!
- AlSweigart 12y agoHi, author here. My email is al@inventwithpython.com and Twitter is @AlSweigart. Please do send me feedback/questions. I'm currently working on the HTML version of the book to be posted online, which will be at http://automatetheboringstuff.com http://automatetheboringstuff.com
- danso 12y agoThis is awesome...I've actually been writing a Python 3.x guide like this for my own class...the more I teach programming, the more I find it necessary to tell students that programming is about learning how to make computer do shit work so that you can do the "real" work (at least, the thinking/designing phase). And so when figuring out what to do with programming, focus your programs on doing things you've already done before...just like when you learn Mandarin Chinese, you do it to be able to express things you've already expressed before in English, but to a wider/different audience. edit: I had pitched this topic for a conference, though I'm mostly expecting it to be rejected for, well, being too mundane :) http://srccon.org/sessions/proposals/#proposal-106215 http://srccon.org/sessions/proposals/#proposal-106215 > Programming creates so many technical and creative inventions that it's natural for aspiring programmers to dream of big projects in the cloud. But this ambition ignores the actual goal of programming, which is almost completely about making machines do mundane work. And it is counterproductive to learning how to program, which requires consistent practice as in every other form of literacy and art. So this session will be about mundane programming. Programming not to be the next Zuckerberg, or to get a better job 3 months from now, but to make today or just the next ten minutes more enjoyable. Instead of focusing specifically on how to code, we'll expand upon the reasons of why we code (though seeing is often believing when it comes to code, so feel free to bring both ideas and Gists). And we'll trim the personal prerequisites of programming, which don't include being an entrepreneur, having a profitable idea, building a website, contributing to open source, or changing the world or your career. Programming can be learned, and done, with a willingness to learn and a wide variety of small problems to practice upon.
- chucksmash 12y agoIf your talk gets accepted please post the video and/or transcript.
- panglott 12y agoYes, post the video!
- level09 12y agoI was thinking about similar concepts and problems then I decided to create a framework [1] that could possibly solve those problems. I created a lightweight system, that serves web pages, added proper authentication, storage (mongodb), memory storage/cache (redis) , simple ORM (mongoengine), automatic backend, background processing/scheduling (celery), email integration, single command deployment (automation) I have also demonstrated how to do scrapping/scheduling/email sending in this tutorial: https://medium.com/project-enferno/create-your-first-minion-with-project-enferno-f7884aa95443?source=latest https://medium.com/project-enferno/create-your-first-minion-... and this one explains how to automate the deployment of everything you create with the framework with a single command: https://medium.com/project-enferno/tip-deploy-enferno-framework-on-ubuntu-with-a-single-command-cc1a596ec3f7 https://medium.com/project-enferno/tip-deploy-enferno-framew... Hope someone will find this helpful. [1]:My framework is called Enferno: http://enferno.io http://enferno.io and runs on top of flask.
- iamd3vil 12y agoThis is awesome! Thank you.
- kramden 12y agoThis is cool but why wouldn't you just do all this in bash?
- adamnemecek 12y agoBecause I've noticed that my general happiness in life is inversely proportional to the time I spend writing bash.
- andrewchambers 12y agoPython works better on windows than bash does. This is for less technical people who may not want to install and maintain cygwin.
- lmm 12y agoBash has more "gotchas" to remember, and tends to be less readable.
- scrollaway 12y agoAre you really asking why one wouldn't "read PDF and word documents", "parse CSV and json files" or "manipulate images" in bash?
- collyw 12y agoBash is great for really simple things, like renaming a load of files in a loop but the bigger the scrip gets the more I would move towards Python. (i.e. more than one nested loop). Plus somethings are horrendous to remember the syntax for, like capturing a regular expression group. (My personal choice would probably be Perl for many of the tasks, though I would point beginners to Python for its readability).
- panglott 12y agoBecause if you're going to learn a programming language to automate the boring stuff, Python will be easier and take you farther.
- AlSweigart 12y agoYou... probably aren't the book's intended audience. :) But seriously, Python makes easy things easy. In bash, just to extract a substring you need to do something like echo someletters_12345_moreleters.ext | cut -d'_' -f 2 That's not very beginner-friendly.
- fierycatnet 12y agoAny recommendations for similar material but for Ruby?
- mazuhl 12y agoEvery Day Scripting with Ruby by Brian Marick, published by Pragmatic Programmers.
- deleted 12y ago[deleted]
- leni536 12y agoIt's a great title. "Automate the Boring Stuff" seems to be the direct replacement (more or less) of "programming" for me. Maybe people without programming experience don't usually realize that programming is mostly about "automating the boring stuff". This title appeals for this simple "use case" which could win against the "scariness" of programming. Or maybe it's not that scary for people to learn programming if you don't mention the word "programming"? It doesn't seem to be the intention here, the first part's title is "The Basics of Python Programming". But it seems to be a good strategy to appeal with the title first than in the TOC face the reader with the truth: what you are going to read about is programming. I know, I speculate too much. But I really like this title. I can imagine a businessman in a bookstore at the "computer" section looking for Excel or Word books looking into this book, while filtering out all "programming" books in his vision.
- jjp 12y agoI agree the title is great, but unfortunately I fear that same business man will read the table of contents and go so what is the boring stuff that I can automate. I hope that the text brings to life some of the problems that the programming constructs can automate.
- AlSweigart 12y agoAuthor here. I'm hoping the back cover material will work, and the opening story in the first chapter is catchy enough: “You’ve just done in two hours what it takes the three of us two days to do.” My college roommate was working at a retail electronics store in the early 2000s. Occasionally, the store would receive a spreadsheet of thousands of product prices from its competitor. A team of three employees would print the spreadsheet onto a thick stack of paper and split it among themselves. For each product price, they would look up their store’s price and note all the products that their competitors sold for less. It usually took a couple of days. “You know, I could write a program to do that if you have the original file for the printouts,” my roommate told them, when he saw them sitting on the floor with papers scattered and stacked around them. After a couple of hours, he had a short program that read a competitor’s price from a file, found the product in the store’s database, and noted whether the competitor was cheaper. He was still new to programming, and he spent most of his time looking up documentation in a programming book. The actual program took only a few seconds to run. My roommate and his co-workers took an extra-long lunch that day.
- brisance 12y agoI bought the PDF version of this a few weeks ago and it is pretty straightforward. Doesn't really teach you anything about classes/object-oriented programming. It really has a strong focus on getting sh*t done and is well-suited for it. Overall I would recommend this if you already have some programming experience. By the way, if you have the book and are experiencing problems with `pip3 install python-docx` on OS X Yosemite, the solution is to install the Xcode command line tools first: xcode-select --install Then `pip3 install python-docx`
- deleted 12y ago[deleted]
- collyw 12y agoHonestly, that's all that many people need. Object orientation and concepts like those are useful for big systems, but simple automation doesn't always require it.
- AlSweigart 12y agoYeah, I've always been of the mindset that until your programs get over 1000 lines of code, you probably don't need OOP. Thanks for the pip3 tip, I'll post it on the website as I get content up.
- QuasiAlon 12y agoThis is cool. Python 2.x or 3.x?
- werid 12y agoIt's python 3
- QuasiAlon 12y agothanks, and also - :(
- scrollaway 12y agoWhy would any new material, educational material especially, ever use Python 2?...
- collyw 12y agoThere is very little stuff that is different between the two languages that you are likely to encounter on a day to day bases.
- QuasiAlon 12y agodon't think there was room for a downvote really... I'm used to python 2 syntax and would argue more than 50% of python enthusiasts prefer it.
- kfk 12y agoThis book title seems also a great proposition for a software company aimed at improving and automating enterprise office work...
- AlSweigart 12y agoAuthor here. I guess so, but there are plenty of software companies with products to "increase office productivity". But at the same time, there are a lot of times where you need a very specific, one-off, 30 line script to do something for your particular job/company. This is where knowing a general (and easy to use) programming language like Python comes in handy. Hence why I wanted to write a programming book for office workers who wanted to skip the computer sciencey and software engineering aspects. Who cares if a throwaway script is O(N^3) if N is going to be a few hundred? Most of the time these things don't matter, because it's still faster than doing this stuff by hand.
- AlSweigart 12y agoHi, author here. The HTML version of the full book content will be up in a few days. (I'm formatting it right now.) Meanwhile, you can use PYBUTLER for a 30% discount on the book/ebook, and I'm offering a 70% discount on my other books: http://inventwithpython.com/blog/2015/04/21/celebrating-the-release-of-automate-the-boring-stuff-with-python-with-discount-codes/ http://inventwithpython.com/blog/2015/04/21/celebrating-the-... Basically, it's a book for complete beginners who don't necessarily want to be software devs but do want to automate parts of their office job. Part 1 is a bare bones Python tutorial (I skip OOP entirely) and Part 2 covers practical stuff: moving/renaming/copying files, updating Excel spreadsheets, parsing PDFs and Word docs, web scrapping, GUI automation.
- egillie 12y agoGreat title, great cover, nice job Al!
- AlSweigart 12y ago:)
- galfarragem 12y agoAny recommendations for similar material but for Javascript?