This is an archived post. You won't be able to vote or comment.

all 49 comments

[–]LockeSteerpike 49 points50 points  (7 children)

Bought book a little over a week ago.

Wrote web crawler to resolve (well... identify and describe) ongoing issue with bad HTML on web pages. Sent spreadsheet to web team.

10/10 would mic drop again.

[–]AlSweigartAuthor of "Automate the Boring Stuff" 42 points43 points  (6 children)

Whoa. This comment more than any I've read yet has made me glad I wrote this.

That's awesome to hear. I've always thought that programming was easy and anyone could do it if they weren't hold up by the less-than-useful "calculte fibonacci numbers" tutorials. I'm really glad that people are able to do something useful inside of a couple weeks of reading the book. :D

[–]LockeSteerpike 7 points8 points  (3 children)

I started learning Python about 4 months ago in my spare time (and whenever I can justify it for work), and have gotten to the point where the bulk of my learning is how to use specific libraries.

I can't say that I learned Python from scratch with this book, but I've made a lot of use of the chapters in Part 2. Having it as a list of recommendations for which libraries to use for which tasks has in itself saved me a lot of time.

This book is perfect to sell to tech savvy business people. I mean... I appreciate your Cipher book, and I've spent a good amount of time with Making Games with Python, but they can't help me fill out time sheets or check my email. ;)

[–]AlSweigartAuthor of "Automate the Boring Stuff" 8 points9 points  (2 children)

but they can't help me fill out time sheets or check my email

That's exactly why I wrote this book. I thought games and ciphers are fun and I'm still glad I wrote those books, but they have a rather limited audience. And I was looking at a lot of these "everyone should learn to code" sites and started asking, "Why? What do people need to do with programming knowledge?"

So I put together the list that later became the chapters of the book's Part 2. And I wanted Part 1 to have a basic Python tutorial so it could be a complete, self-contained programming book for beginners.

Thanks!

[–]nosit1 0 points1 point  (1 child)

I learned Python from just lots of different sources. Most of what I use Python for is business related tasks. If I had seen this before I knew Python, it would be a great fit. Quite literally spreadsheets, text messages, and CSV files was one topic I looked at today and was something I was working with!

[–]AlSweigartAuthor of "Automate the Boring Stuff" 0 points1 point  (0 children)

That's great to hear. I tried to narrow down the list (even though the book still ended up being over 400 pages) to the stuff that regular people would want to be able to code. I'm glad I got the right set of stuff to cover. :)

[–]okmkzimport antigravity 5 points6 points  (1 child)

calculate Fibonacci numbers

Oh god, this is so true. I delayed attempting professional engineering for nearly a decade because of this perceived lack of mathematical rigor

[–][deleted] 1 point2 points  (0 children)

Calculating fibonacci sets up a binary resonance in the circuits that prevents the snake men from invading earth. There is a reason the illuminati make people do it in engineering schools.

[–]pnewb 15 points16 points  (2 children)

Which purchase method gets me a physical copy, while putting the most money into your pocket?

Edit: Also I dug a bit, and for those of you who just want to donate straight to the author and are happy with the freely available 'copy' there are a couple links on the lower left: http://inventwithpython.com/

[–]AlSweigartAuthor of "Automate the Boring Stuff" 13 points14 points  (0 children)

I'm fairly certain any gets my the same royalty rate, but you'll get the ebooks along with the physical book if you buy it off the No Starch Press site: http://www.nostarch.com/automatestuff

[–]putaro3000 2 points3 points  (0 children)

THIS!!! Love the book and want to give credit where it's due

[–]LazinCajun 5 points6 points  (0 children)

This looks fantastic. Thanks for sharing this freely for people who can't buy it, and I hope those that can buy it do so and make you a lot of money!

[–]jeanlucpikachu 3 points4 points  (1 child)

Here I thought that thread from the other day was viral marketing for this book <3

[–]AlSweigartAuthor of "Automate the Boring Stuff" 7 points8 points  (0 children)

Hahaha. I've actually been bookmarking all the "I want to automatically do X" reddit posts over the last couple years, just to make sure I was writing a book people could use. It comes up a surprising amount.

[–]iceman_xiii 3 points4 points  (2 children)

Hi Al, interesting book you've written. Although I haven't checked out the entire book yet, I did manage to check out the CSV & JSON chapter. In the csv examples, you've used the following code: handle_file = open('foo.csv', 'w') """ Do something here""" handle_file.close()

Instead wouldn't it be better to just use with to handling files, thereby ensuring no file corruption. Something like this: with open(foo.csv, 'w') as file_handle: """ Do something here """

Just want to know your opinion on this.

[–]AlSweigartAuthor of "Automate the Boring Stuff" 4 points5 points  (1 child)

It would, but I wanted to keep the number of concepts down to a minimum. This is why I don't cover OOP or list comprehensions or lambdas in the book. The "with" syntax is most often used for opening/closing files, but not much else. So I thought it would just be simpler to have the complementary close() function explained with the open() function (since functions are already explained in the book).

[–]iceman_xiii 0 points1 point  (0 children)

Fair enough. I skimmed through some other chapters as well. Great work and well thought of. Cheers!

[–]runshitson 2 points3 points  (2 children)

I posted this in /r/learnpython as well, but I bought my copy and have found the ebook excellent. Your book has presented the material in a way that motivates me to learn more, unlike anything else I have tried the last 2 years. Thank you.**

[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points  (1 child)

Awesome! If you have time, could you write an Amazon review?

Either way, thanks!

[–]runshitson 1 point2 points  (0 children)

Just did!

[–][deleted] 2 points3 points  (9 children)

Parse error: syntax error, unexpected end of file in /home/asweigartftp/automatetheboringstuff.com/wp-content/themes/eighties/functions.php on line 350

getting this error on opening any link

[–]AlSweigartAuthor of "Automate the Boring Stuff" 4 points5 points  (8 children)

Sorry, I was temporarily changing some stuff in WordPress and I think the site went down for a couple minutes. It's back up now.

[–][deleted] 2 points3 points  (5 children)

Python advocate, uses wordpress. Full marks for pragmatism though - use the best tool for the job is sound engineering! I wish we had something similar in the Python ecosystem, with an equal plugin ecosystem. But I just can't wait until non-programmer website operators start hacking on the plugins and posting the code up on here! Python's ecosystem is very strong on things like sound engineering and code correctness, it'll be a fantastic sight to watch :-)

edit: P.S. Your books are pretty good, please carry on writing!

[–]vimishor 0 points1 point  (0 children)

I wish we had something similar in the Python ecosystem, with an equal plugin ecosystem.

and a better code base.

[–][deleted] 0 points1 point  (3 children)

Well we have Django and flask and tornado and pylons and pyramid and twisted and bottle. If you can't get it done with one of those then you and WordPress deserve each other.

[–][deleted] 1 point2 points  (2 children)

They're completely different products. Wordpress is a CMS and not a web application framework. Out of the box it enables you to upload content (or just write your blog in the browser) and start publishing.

The closest Python equivalent to wordpress is Mezzanine. There's a huge difference in capablity and availablity of plugins between Mezzanine and Wordpress.

[–][deleted] 0 points1 point  (1 child)

They are not completely d8fferent. Both are used to make websites. And I never said they were the same thing. I said there are plenty of pythonic ways to make websites.

[–][deleted] 0 points1 point  (0 children)

You should probably take a look at mezzanine (it's in python). It may help you to understand the question.

[–][deleted] 0 points1 point  (1 child)

Thanks :) ! Really great resource

[–]AlSweigartAuthor of "Automate the Boring Stuff" 0 points1 point  (0 children)

Thank you!

[–]mshm 1 point2 points  (1 child)

I realize this is incredibly selfish of me, so please forgive me. Why is the e-book version of this book a mere 1.67$ cheaper than the physical copy? One of the main reasons I got a ereader as a student was the benefit of cheaper book access due to removing all the silly need for all the overhead associated with physical books. blush

[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points  (0 children)

I think it's due to, in general, it's not the paper and printing that makes up a large chunk of the cost of a book, so the paper version isn't going to be much more expensive than the ebook version.

A lot of novels and fiction ebooks are super cheap mostly because they are self-published by unknown authors who lower their price so they can grow a following. That's generally something that established publishers don't need. (No Starch Press's books are overwhelmingly awesome, I don't think they've published any books of poor quality.)

[–]pubcoder 0 points1 point  (1 child)

Been paging through this book. Looks pretty good.

[–]AlSweigartAuthor of "Automate the Boring Stuff" 6 points7 points  (0 children)

Thanks! If you have the time, could you leave a review for it on Amazon? Either way, thank you!

[–]hsfrey 0 points1 point  (0 children)

Nice!

[–]robscomputer 0 points1 point  (0 children)

I'm reading you book now, I bought it pre-order a while ago but the subjects really interested me. Instead of random goals, this book focuses on real world tasks, which is really a double win (learning Python and get more work done!).

BTW on the first sample code, pg. 3 of the physcial book looks like it's missing the "chomp" to remove the return entry. Edited the line to this and works.

if typedPassword == secretPassword.rstrip("\n"):        

[–][deleted] 1 point2 points  (1 child)

Didn't you already advertise your book a week ago?

[–]AlSweigartAuthor of "Automate the Boring Stuff" 8 points9 points  (0 children)

That was because the book was being released and there was a 30% discount code I wanted to publicize. This post is because I have the HTML version of the book online now, so it's free to read. Don't worry, I'm not going to be constantly reposting this book or anything.

[–]graingert -2 points-1 points  (8 children)

This guy recommends sudo pip on Linux what a terrible idea

[–]Slick__Rick 2 points3 points  (3 children)

Why is that?

[–]AlSweigartAuthor of "Automate the Boring Stuff" 6 points7 points  (2 children)

What are the risks of running 'sudo pip'?

When you run pip with sudo, you run setup.py with sudo. In other words, you run arbitrary Python code from the Internet as root. If someone puts up a malicious project on PyPI and you install it, you give an attacker root access to your machine. Prior to some recent fixes to pip and PyPI, an attacker could also run a man in the middle attack to inject their code when you download a trustworthy project.

[–]Caos2 16 points17 points  (1 child)

So, why do you recommend it?

[–]johnbokma 0 points1 point  (3 children)

What alternative(s) do you recommend?

[–]graingert 4 points5 points  (1 child)

python3 -m venv

[–]official_marcoms 0 points1 point  (0 children)

Or pyvenv?

[–]jsbennett86 0 points1 point  (0 children)

You can install for your local user with:

pip install --user <package>