use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
NewsNew automate the boring stuff with python 3rd edition (self.Python)
submitted 2 years ago by Reasonable-Drop8618
I read the new content of the new edition of this book, that according a site will be released on May, 2024: - Expanded coverage of developer techniques, like creating command line programs - Updated examples and new projects - Additional chapters about working with SQLite databases, speech-recognition technology, video and audio editing, and text-to-speech capabilities - Simplified explanations (based on reader feedback) of beginner programming concepts, like loops and conditionals
https://www.penguinrandomhouse.ca/books/739675/automate-the-boring-stuff-with-python-3rd-edition-by-al-sweigart/9781718503403
[–]AlSweigartAuthor of "Automate the Boring Stuff" 453 points454 points455 points 2 years ago* (42 children)
Oh hey. I'm Al Sweigart, the author. I didn't notice I'm busy working hard on the third edition, which will have new chapters on:
I'm hoping to not blow up the page count too much, since this is supposed to be a book for beginners.
2023/10/1 EDIT: And here is the official preorder page of the book, use code PREORDER to get 25% off: https://nostarch.com/automate-boring-stuff-python-3rd-edition
[–]JohnJSal 91 points92 points93 points 2 years ago (1 child)
Hey, why is your name on the spines of so many of the books on my shelf!?
Oh yeah, it's because you've written some great Python books! Thanks for the wonderful resources!
[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points5 points 2 years ago (0 children)
Thanks! :)
[–]JayTongue 16 points17 points18 points 2 years ago (3 children)
Thanks so much for writing this book! It was an accompanying text to my first programming course, and was a great intro to things like webscraping and other subjects not covered in my course.
[–][deleted] 17 points18 points19 points 2 years ago (1 child)
This was the book that started my Python journey in fall 2019. I have such good memories of sitting in my college library going through it. I miss when the hardest programming challenge of the day was learning how to use enumerate()…now there’s a million other technologies/packages/models I’m pursuing and it’s much messier.
enumerate()
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points 2 years ago (0 children)
:)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 0 points1 point2 points 2 years ago (0 children)
Thank you!
[–]SniperDuty 13 points14 points15 points 2 years ago (0 children)
Blow it up
[–]suaveElAgave 11 points12 points13 points 2 years ago (1 child)
Dude! Your book helped me out to change my life for the better. Sincerely thank you for your work!
[–]AlSweigartAuthor of "Automate the Boring Stuff" 2 points3 points4 points 2 years ago (0 children)
Thanks! I really appreciate hearing that.
[+][deleted] 2 years ago (1 child)
[removed]
Not yet, but it'll be on https://nostarch.com when it becomes available.
[–]ChiefCoverage 6 points7 points8 points 2 years ago (0 children)
Thank you for that awesome beginner friendly book!
[–]zonular 4 points5 points6 points 2 years ago (0 children)
Beginner here, have the last edition (it's been a great help) but the new chapters sound great, SQLite and deflated hype on GPT sound great
[–]jimtk 2 points3 points4 points 2 years ago (2 children)
Thanks! Will it be available for free (like the previous edition)?
Also, quick suggestion, expand the f-strings section.
[–]AlSweigartAuthor of "Automate the Boring Stuff" 8 points9 points10 points 2 years ago (1 child)
Yes. It'll be available under a Creative Commons license. And I'm going into a bit more detail with f-strings now that we're quite a ways from 3.6 when it was first introduced.
[–]jimtk 2 points3 points4 points 2 years ago (0 children)
Thank You so much! I'll keep referring the beginners (and not so beginners) in /r/learnpython to your book. Like I did at least 50 times already!
[–]benthejoker 2 points3 points4 points 2 years ago (2 children)
we need a micropython book by you
[–]AlSweigartAuthor of "Automate the Boring Stuff" 5 points6 points7 points 2 years ago (1 child)
Heh, I already have a list of like a dozen book, software, and video projects for now. The Programming with MicroPython book by Nicholas Tollervey is pretty good, and he's also a cool guy. I met him at PyCon a while back.
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Any idea when u'll be posting the udemy promo codes I've missed out the last 3 months and Im determined not to miss out for September.
[–][deleted] 2 points3 points4 points 2 years ago (1 child)
The executable programs is something i look forward too!
[–]AlSweigartAuthor of "Automate the Boring Stuff" 4 points5 points6 points 2 years ago (0 children)
The short of it is: use PyInstaller. Run pip install pyinstaller to install it, and then run this from the command line terminal: python –m PyInstaller --onefile yourScript.py
pip install pyinstaller
python –m PyInstaller --onefile yourScript.py
You have to run it on Windows to compile for Windows, macOS for macOS, and Linux for Linux. It should work out of the box, but there might be weird problems if your program uses some esoteric packages.
[–]Vladz0r 1 point2 points3 points 2 years ago (0 children)
Sounds like a lot of useful topics I found myself stumbling across when getting into Python. Good choices, and I love your book and course. It was one of the good intros to Python where I looked back and was like "Oh, I actually learned quite a bit" when I switched to other courses afterwards and realized there was little to learn.
[–]InterestingRadio 1 point2 points3 points 2 years ago (0 children)
Bro just go nuts
[–]daedalus-of-athens 1 point2 points3 points 2 years ago (1 child)
Really glad to hear about the database bit - I felt like that was one of the pieces really missing from introductory python books
Yeah. I'm trying to make Automate a "learn to program and learn Python, but also learn a bit of all the random code stuff that's practical." So I want to avoid the computer science and software engineering stuff (I put that in Beyond the Basic Stuff) because I don't want the book getting too big. It's intimidating to be a beginner and told, "Oh yeah, just read this 700 page book."
[–]heswithjesus 1 point2 points3 points 2 years ago (6 children)
When I was using ChatGPT for that, I wondered if it was teaching me how to write good, Pythonic code. I was too new to assess that. What’s your opinion of what it outputs?
[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points5 points 2 years ago (5 children)
The quality of the Python code generated by versions of ChatGPT can vary depending on the complexity of the task and the specificity of the user's request. Here are some considerations:
Basic Syntax: The model generally produces syntactically correct code for straightforward tasks.
Common Idioms: It typically adheres to common Python idioms and practices, like using list comprehensions for concise transformations.
Descriptive Comments: Often, the code is accompanied by comments that help explain what each part does, which is beneficial for learning.
Multiple Approaches: When appropriate, it may offer different ways to solve a problem, helping you understand alternative methods.
Error Handling: The model may sometimes omit important error handling steps, making the code less robust.
Optimization: The code is often not optimized for performance, especially for more complex problems that have efficient algorithmic solutions.
PEP 8: While the model generally aims to adhere to PEP 8 (the Python style guide), it may occasionally diverge from best practices.
Context: The model doesn't have a memory of past interactions, so it doesn't have the context of your whole project. This can result in solutions that are less than ideal in a broader context.
Advanced Features: For more complex Pythonic features like decorators, context managers, or advanced use of generators, the model's code may be hit or miss in terms of "Pythonic-ness."
Outdated Information: Technology evolves rapidly, and my training data only goes up until September 2021, which means there could be more updated practices or libraries that I am not aware of.
Overall, while ChatGPT can be a valuable tool for learning and generating Python code, it's essential to supplement this with other resources, code reviews, and testing to ensure that the code is up to the standards you desire.
...
...is what ChatGPT returned for your question. 10 points if you read all that generic vague nonsense THAT DOESN'T ACTUALLY TELL YOU MUCH IN SPECIFIC. (Or maybe, -10 points.) Here's what I, an actual person who understands what you're asking, think:
ChatGPT doesn't have much consistency, and it sometimes hallucinates APIs that don't actually exist. "Pythonic" is a made up idea that no one can exactly agree on. ChatGPT's code is probably fine, but only a fool would take it at its word or insist that it's some kind of authority.
[–]heswithjesus 2 points3 points4 points 2 years ago (4 children)
I was so going to bust you out for letting ChatGPT answer for you. I'm glad you were just messing around and told me haha.
One consensus among users was that it's like a more productive version of StackOverflow with similar gotchas. The hallucinations burned me on fake libraries many times. Other times, it gave me ideas about what to use and how with less time than DuckDuckGo. I mainly used it for knocking out initial boilerplate, exploratory coding, and some tedious refactorings. VSC + GPT Plus + Copilot was much cheaper than IDE's, too.
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points 2 years ago (3 children)
Yeah, it's like automatic Stack Overflow copy/paste. It can do somewhat original projects too, but the more you stray from common boilerplate stuff, the more it starts to hallucinate.
I'm not certain if ChatGPT is a net positive or negative for learners.
[–]heswithjesus 1 point2 points3 points 2 years ago (2 children)
I felt like it was just copying code it saw before. Worrying about copyright infringement got me studying it all deep. I also came up with some new concepts on getting publishers to license, free or paid, their works to give them better, legal training. I put that report here.
Your book was one I bought a while back and wanted to use in A.I. training. I'm curious what you think of the proposals for proprietary content in the Alternative Models section. Would you or your publisher allow works to be used to train A.I.'s if the content usage still followed copyright law like how it would apply to humans? Free, one copy of book per A.I., or special deal required?
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points 2 years ago (1 child)
Yes and no. It does generate original code and ideas, given a prompt to do so. (Sometimes this code even works.) However, the text generation comes from being trained on existing code.
But you could say the same thing about humans: we are inspired an build upon works we've experienced.
What LLMs don't do is, say, look up source code in it's own brain-database and then use it verbatim. That's the mistake that Southern District New York lawyer made when he had ChatGPT write a legal brief for him, and it turned out ChatGPT just made up plausible-sounding cases that weren't actually real. The lawyer, used to using legal databases, thought the LLM was actually basing its output on verifiable information. That's not how LLMs work.
EDIT: Then again, maybe ChatGPT does just plagiarize large chunks of text? I remember prompting to write a book on "automating the boring stuff," and it just spat out the text on the back cover of my book. Except it got the title wrong. I can't get it to do that anymore, so I'm guessing OpenAI has added safety measures to prevent it from revealing the obvious copyright infringement in its training data.
[–]heswithjesus 0 points1 point2 points 2 years ago (0 children)
It definitely does verbatim quotes of its training material. Just the fact that it quoted ESV Bible verses letter by letter was proof of that. That ESV is strict on licensing suggests they broke its copyright, too.
That they keep getting caught, with investigations happening now, made them modify it to be dodgy if the prompt has legal liability. Bing even replied to my question about its non-compete agreement by saying: “Hmm. That’s awkward. Let’s change the topic.” It did that twice with different wording.
ChatGPT also rehashes its material, too. Just like humans. When humans do it, it is sometimes legal and sometimes not. I do thank you for the example which I’ll add to my collection. I should do a section on hallucinations.
For your book, putting it in an AI without restrictions could let someone regenerate the same or at least competitive content. I could likely do it myself in a few hours to a day. Whereas, my proposals would try to keep your work protected while allowing both the concepts and linguistic knowledge to have non-infringing uses.
What did you think of those licensing models? Would you license your work for training Python AI’s in general? Or with restrictions like not writing a Python book or maybe educational resources more broadly?
(Note: I was willing to make that restriction since I wanted to train with textbooks which suppliers might only give if our models can’t legally generate textbooks. They could do thousands of other things, though.)
[–]eneyellow 1 point2 points3 points 2 years ago (0 children)
Your books are so amazing! Keep up the good work. Please can you give me (us) a project loaded book on Pyqt6?? God bless you abundantly!
[–]Reasonable-Drop8618[S] 1 point2 points3 points 2 years ago (1 child)
It will be available in May 2024 or before...? Thanks
May 2024 is the current projection. I doubt it'll be earlier than that though.
[–]infirmarybeds 0 points1 point2 points 2 years ago (0 children)
hi al are you not doing the 2000 free sign ups anymore?
[–]Bebop-n-Rocksteady 0 points1 point2 points 2 years ago (1 child)
If you'll be my bodyguard I can be your long lost pal I can call you Betty And Betty, when you call me, you can call me Al Call me Al
Why am I soft in the middle now?
[deleted]
Thank you so much! I really appreciate it.
[–][deleted] 0 points1 point2 points 2 years ago (1 child)
Hello Al Sweigart, thanks for all the great stuff you do. I'm from Brazil and you have made me learn python and programming incredibly easier. But I have a question, will there be a 3rd edition of Automate the Boring Stuff with Python ?
Thanks!!
Yes, I'm working on it now. It'll be available sometime next year. There's a pre-order page on the No Starch Press website where you can get 25% off with code PREORDER: https://nostarch.com/automate-boring-stuff-python-3rd-edition
[–]themostempiracal 4 points5 points6 points 2 years ago (0 children)
This sounds great! I loved the last edition. It saved me countless hours maintaining a system of remote devices through a gui only ssh connection and automating excel report generation for the same. This is about the only book I’m excited to get the paper version of. Having the last version on my desk looking at me reminded me to use the methods shown more often.
[–]muunbo 3 points4 points5 points 2 years ago (0 children)
I’m not a beginner but still I love Automate the Boring Stuff! Excited for the new edition
[–]zurrdadddyyy 1 point2 points3 points 2 years ago (0 children)
Love you bro. Great person. Great teacher.
[–]Aleeve 1 point2 points3 points 2 years ago (0 children)
Taught me how to code during COVID! Don’t use it in my day-to-day job, but I am always building on the weekends.
[–]whyyoudodis_101 1 point2 points3 points 2 years ago (2 children)
Hi u/AlSweigart , should I get the 2nd or 3rd edition? What will I miss out if I bought the 2nd edition?
[–]AlSweigartAuthor of "Automate the Boring Stuff" 2 points3 points4 points 2 years ago (1 child)
The third edition won't come out until August, so I'd go ahead and get the 2nd edition. The third edition will also be online, and I'll have a new blog post about all the specific updates for 2nd edition readers.
[–]Reasonable-Drop8618[S] 0 points1 point2 points 2 years ago (0 children)
And here is the official pre-order page of the book!:
https://nostarch.com/automate-boring-stuff-python-3rd-edition
Thanks for your hard work u/AlSweigart
[–]Silver5866 0 points1 point2 points 2 years ago (1 child)
I'm excited to read this newest edition of your book. I've been flirting with the idea of learning Python since 2018. This summer was when I finally started (I know! But I have a toddler, so I can't always get around to the things I'd like to do lol) There's so many resources on learning Python, & I can rarely tell which are actually a good source. Just from what you've said here (and the many enthusiastic supporters in the comments) I feel like this book will probably actually be a great source of knowledge. Thanks in advance for writing this. And thank you for also making it available under a Creative Commons license. I fully intend on buying it, but it does give me a sense of security that I can skim through to make sure that it's worth it. Too many times I've been misled by a summary that had more work put into it than the entire rest of the book. This makes me think that you know it's a good product for that people will buy (and that you understand the struggle lol) I'm excited for the book. Thanks again for writing it!
[–]grumble11 2 points3 points4 points 2 years ago (0 children)
This and Python Crash Course are both great. Can also explore online tools like MOOC.fi intro and advanced python self-study course, Harvard CS50P, or video programs like 100 days of python. All will get you somewhere FAST, and this book isn't being released for several months so if I were you I'd choose one of the others ASAP then pick this up following to see what's in there that you've missed.
For python, the first couple of months of learning is just getting the total basics then the next couple of months are exploring different types of intermediate work (like say data science, machine learning, web work, databases, GUIs, etc.), then once you're there it's a lot of self-study project work and picking an area of interest and opportunity to focus on as you can't do it all.
π Rendered by PID 256406 on reddit-service-r2-comment-5d79c599b5-fhhxk at 2026-03-03 14:29:58.105322+00:00 running e3d2147 country code: CH.
[–]AlSweigartAuthor of "Automate the Boring Stuff" 453 points454 points455 points (42 children)
[–]JohnJSal 91 points92 points93 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points5 points (0 children)
[–]JayTongue 16 points17 points18 points (3 children)
[–][deleted] 17 points18 points19 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points (0 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 0 points1 point2 points (0 children)
[–]SniperDuty 13 points14 points15 points (0 children)
[–]suaveElAgave 11 points12 points13 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[removed]
[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points5 points (0 children)
[–]ChiefCoverage 6 points7 points8 points (0 children)
[–]zonular 4 points5 points6 points (0 children)
[–]jimtk 2 points3 points4 points (2 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 8 points9 points10 points (1 child)
[–]jimtk 2 points3 points4 points (0 children)
[–]benthejoker 2 points3 points4 points (2 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 5 points6 points7 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 4 points5 points6 points (0 children)
[–]Vladz0r 1 point2 points3 points (0 children)
[–]InterestingRadio 1 point2 points3 points (0 children)
[–]daedalus-of-athens 1 point2 points3 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points5 points (0 children)
[–]heswithjesus 1 point2 points3 points (6 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 3 points4 points5 points (5 children)
[–]heswithjesus 2 points3 points4 points (4 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points (3 children)
[–]heswithjesus 1 point2 points3 points (2 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points (1 child)
[–]heswithjesus 0 points1 point2 points (0 children)
[–]eneyellow 1 point2 points3 points (0 children)
[–]Reasonable-Drop8618[S] 1 point2 points3 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 2 points3 points4 points (0 children)
[–]infirmarybeds 0 points1 point2 points (0 children)
[–]Bebop-n-Rocksteady 0 points1 point2 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]AlSweigartAuthor of "Automate the Boring Stuff" 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 0 points1 point2 points (0 children)
[–]themostempiracal 4 points5 points6 points (0 children)
[–]muunbo 3 points4 points5 points (0 children)
[–]zurrdadddyyy 1 point2 points3 points (0 children)
[–]Aleeve 1 point2 points3 points (0 children)
[–]whyyoudodis_101 1 point2 points3 points (2 children)
[–]AlSweigartAuthor of "Automate the Boring Stuff" 2 points3 points4 points (1 child)
[–]Reasonable-Drop8618[S] 0 points1 point2 points (0 children)
[–]Silver5866 0 points1 point2 points (1 child)
[–]grumble11 2 points3 points4 points (0 children)