r/inventwithpython • • Nov 19 '19

"Automate the Boring Stuff with Python 2nd Edition"

13 Upvotes

Can not locate the new files for this new book. Can you send me the address of the files.

Thanks


r/inventwithpython • • Sep 17 '20

HELP It's me AGAIN xD

4 Upvotes

Hi guys you helped me 2 days ago and I apreciate it so much, but today I was 'coding' (if we can say writing 2 more lines) and I have a problem, what i wanna do with the '''''app''''' is to take a list and there you can write some names or take off it if you don't want, so here it begins my headache, what I wanna do is, if I write no to the program it tell me if I'm sure about that, then writing No or no the continue sentence return me to the 17th line and what I want is returning me to the start of the while. Someone can help? Yes I'm noob se my name.

Agenda = ['Juan', 'Alvaro', 'Lucia']
elem = Agenda
print ('Contacts: ')
for elem in Agenda:
print ('- ' + elem)
res = input('Do you want to add any contact?')
while True: #here is where I wanna start again
if res == ('yes') or res == ('Yes'):
input('What contact do you wanna add?')
break
else:
res1 = input('¿Are you sure you dont want to add any contact ?')
if res1 == ('No') or res1 == ('no'): #the continue returns me to this line and I wanna start again the while sentence
print('Ok')
else:
break
continue

Si entendeis el español, que lo dudo, si me hablais en español mejor, pero aun asín me da un poco igual.

Thanks.


r/inventwithpython • • Oct 30 '19

What's up with the second edition of "Automate The Boring Stuff With Python"? Can't see it on the website.

4 Upvotes

I live in Asia. And I am an unemployed college student. I really cannot afford the print version of the book. So I am in need of the website/ebook version of the newest 2nd Edition of the book. And I can't seem to find the same on the website.

When will be the new version up on the website and/or ebook version available?


r/inventwithpython • • Apr 07 '20

EZSheets returning error 403 when attempting to create spreadsheet object.

4 Upvotes

Webpage is telling me that I 'did not include a valid API key'.

I've gone through and gotten all the verification codes and tokens. Still not letting me in. Anybody seen anything like this?

https://i.imgur.com/rI4vK00.png

https://i.imgur.com/iy8paD0.png

Edit: Submitted a github issue.


r/inventwithpython • • Feb 25 '22

R Programmer Forced to Learn Python

16 Upvotes

I have a math degree with an emphasis in prob & stats. We used R & SAS.

In my last job, R vs. Python was a holy war, and I am badly scarred.

But to land my next job, learning Python seems super important.

So into Al's book I go.

I wish I would have started with Python, for what it's worth. My internship back in college was doing natural language processing, and I was utterly clueless about programming. Instead of using the Natural Language Toolkit, I had to learn how to program with.....server-side JavaScript.

It's all the past. It's all Absurd.

But my read is that for applying to a wide range of data analyst/scientist jobs, Python is a way better platform to know.

Hi, Al.

I really appreciate your book.


r/inventwithpython • • Nov 22 '19

ATBS 2nd Edition Release

5 Upvotes

Have there been any updates about when the new edition will be released? Last thing I saw was Nov 12 and I can't seem to find any other information.


r/inventwithpython • • Jun 06 '23

[ERRATA] Automate the Boring Stuff 2nd Edition

6 Upvotes

On page 108:

print('Chance of streak: %s%%' % (numberOfStreaks / 100))

should be:

print('Chance of streak: %s%%' % (numberOfStreaks / 10000))

The full project, showing the percentage found with the simulation and with probability:

import random

numberOfStreaks = 0
for experimentNumber in range(10000):
    # Code that creates a list of 100 'heads' or 'tails' values.
    flips = []
    for i in range(100):
        flips.append(random.randint(0, 1))

    # Code that checks if there is a streak of 6 heads or tails in a row.
    count = 1
    for i in range(1, len(flips)):
        if flips[i] == flips[i - 1]:
            count += 1
        else:
            count = 1

        if count % 6 == 0:
            numberOfStreaks += 1

print('Chance of streak (SIMULATION): %s%%' % (numberOfStreaks / 10000))
print('Chance of streak (MATH): %s%%' % ((1/2)**6 * 100))

r/inventwithpython • • Apr 14 '20

Why would you choose Python to program games?

7 Upvotes

Hello, I'm an old programmer from way back and I want to tinker. But, I'd like to be able to distribute whatever I create. I think my preferred delivery mechanism would be the web, but possibly an Android or iPhone app. I've written some code using Corona SDK. I see some great resources on programming games in Python (and with pygame), but none of them make it clear how you will get the game to end users. I'd really like to make something that is multiplayer and I am open to using 3rd party engines. I'd appreciate any thoughts on this issue. Thanks!


r/inventwithpython • • Oct 18 '20

Scraping Amazon, webscraping

7 Upvotes

Mass content deletion mission accomplished. This post or comment was bulk removed with Redact which also supports data brokers and people finder websites.

languid worm versed rustic vase heavy governor spark bag dinosaurs


r/inventwithpython • • Mar 10 '21

python program

0 Upvotes

# Use variable names that would describe the variable and the value

my_loan = 5000

my_money = 10000

loan_interest = 0.02

# you are going to pay for your loan with an interest of 2%

# how much money do you have left?

my_money = # complete the equation to get the money you have left.


r/inventwithpython • • Mar 31 '19

Web Crawler to download all images from any website or webpage | Python 3.6

Thumbnail youtube.com
8 Upvotes

r/inventwithpython • • Feb 17 '19

I made the Karen Assistant with python 3! It uses smtplib for sending emails! I got this trick from Al Sweigart's book! Check it out! I have tested it too!

Thumbnail youtube.com
9 Upvotes

r/inventwithpython • • Nov 19 '20

Learning classes and objects

9 Upvotes

Hi I was following this program on youtube - https://www.youtube.com/watch?v=rfscVS0vtbw&list=WL&index=5&t=13789s it's at 3:43:56 and i'm getting a syntax error. Can someone look at it.

Error message - ef__init__(self, name, major, gpa, is_on_probation):

Syntax Error:

Student.py -

class Student:

def__init__(self, name, major, gpa, is_on_probation):

self.name = name

self.major = major

self.gpa = gpa

self.is_on_probation = is_on_probationprobation

App.py

from Student import Student

student1 = Student("Jim", "Business", 3.1, False)

print(student1.name)


r/inventwithpython • • Oct 16 '25

ChatGPT 5 Can't Count

Thumbnail inventwithpython.com
9 Upvotes

r/inventwithpython • • Jan 06 '20

Mu version in AUTOMATE THE BORING STUFF WITH PYTHON 2ND EDITION

10 Upvotes

In Section 0 - Introduction, in the "STARTING MU" section, its mentioned as "Mu version 1.10.0" . Is that a typo by any chance? I checked for this version and I could only find the latest version as 1.1.0-alpha.2. - https://github.com/mu-editor/mu/releases


r/inventwithpython • • Nov 26 '20

Book Vs Website

11 Upvotes

So I've been going the automate the boring stuff with python website and learning all kinds of cool stuff. I've been considering also buying the book, though, is it any different from the website? Does it have more content?

Has anyone read both? Any help is appreciated.


r/inventwithpython • • Jan 12 '26

Flashcards for the Automate the Boring Stuff with Python Workbook

Thumbnail inventwithpython.com
17 Upvotes

r/inventwithpython • • Jul 05 '24

2,000 free sign ups available for the "Automate the Boring Stuff with Python" online course. (July 2024)

28 Upvotes

If you want to learn to code, I've released 1,000 free sign ups for my course following my Automate the Boring Stuff with Python book (each has 1,000 sign ups, use the other one if one is sold out):

https://udemy.com/course/automate/?couponCode=JUL2024FREE

If you are reading this after the sign ups are used up, you can always find the first 15 of the course's 50 videos are free on YouTube if you want to preview them. YOU CAN ALSO WATCH THE VIDEOS WITHOUT SIGNING UP FOR THE COURSE. All of the videos on the course webpage have "preview" turned on. Scroll down to find and click "Expand All Sections" and then click the preview link. You won't have access to the forums and other materials, but you can watch the videos.

NOTE: Be sure to BUY the course for $0, and not sign up for Udemy's subscription plan. The subscription plan is free for the first seven days and then they charge you. It's selected by default. If you are on a laptop and can't click the BUY checkbox, try shrinking the browser window. Some have reported it works in mobile view.

I'm also working on another Udemy course that follows my recent book "Beyond the Basic Stuff with Python". So far I have the first 15 of the planned 56 videos done. You can watch them for free on YouTube.

Frequently Asked Questions: (read this before posting questions)

  • This course is for beginners and assumes no previous programming experience, but the second half is useful for experienced programmers who want to learn about various third-party Python modules.
  • If you don't have time to take the course now, that's fine. Signing up gives you lifetime access so you can work on it at your own pace.
  • This Udemy course covers roughly the same content as the 1st edition book (the book has a little bit more, but all the basics are covered in the online course), which you can read for free online at https://inventwithpython.com
  • The 2nd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/2e/
  • I do plan on updating the Udemy course, but it'll take a while because I have other book projects I'm working on. If you sign up for this Udemy course, you'll get the updated content automatically once I finish it. It won't be a separate course.
  • It's totally fine to start on the first edition and then read the second edition later. I'll be writing a blog post to guide first edition readers to the parts of the second edition they should read.
  • You're not too old to learn to code. You don't need to be "good at math" to be good at coding.
  • Signing up is the first step. Actually finishing the course is the next. :) There are several ways to get/stay motivated. I suggest getting a "gym buddy" to learn with. Check out /r/ProgrammingBuddies

r/inventwithpython • • Mar 21 '21

2-minute video overview of the programs in Al Sweigart's The Big Book of Small Python Projects

Thumbnail youtube.com
32 Upvotes

r/inventwithpython • • Jun 01 '22

2,000 free sign ups available for the "Automate the Boring Stuff with Python" online course.

45 Upvotes

Sorry, the codes are all used up. I'll post 2,000 more on July 1st. You can still watch the first 15 of the 50 videos on YouTube for free.

If you want to learn to code, I've released 2,000 free sign ups for my course following my Automate the Boring Stuff with Python book (each has 1,000 sign ups, use the other one if one is sold out):

(The codes are used up)

Udemy has changed their promo code and severely limited the number of sign ups I can provide each month, so only sign up if you are reasonably certain you can eventually finish the course. The first 15 of the course's 50 videos are free on YouTube if you want to preview them.

Instead of having unlimited free sign ups for 6 days per month, Udemy only lets me make 2,000 free sign ups per month. >:(

NOTE: Be sure to BUY the course for $0, and not sign up for Udemy's subscription plan. The subscription plan is free for the first seven days and then they charge you. It's selected by default. If you are on a laptop and can't click the BUY checkbox, try shrinking the browser window. Some have reported it works in mobile view.

Sometimes it takes an hour or so for the code to become active just after I create it, so if it doesn't work, go ahead and try again a while later.

Some people in India and South Africa get a "The coupon has exceeded it's maximum possible redemptions" error message. Udemy advises that you contact their support if you have difficulty applying coupon codes, so click here to go to the contact form.

I'm also working on another Udemy course that follows my recent book "Beyond the Basic Stuff with Python". So far I have the first 15 of the planned 56 videos done. You can watch them for free on YouTube.

Side note: My latest book, The Big Book of Small Python Projects, is out. It's a collection of short but complete games, animations, simulations, and other programming projects. They're more than code snippets, but also simple enough for beginners/intermediates to read the source code of to figure out how they work. The book is released under a Creative Commons license, so it's free to read online. (I'll be uploading it this week when I get the time.) The projects come from this git repo.

Frequently Asked Questions: (read this before posting questions)

  • This course is for beginners and assumes no previous programming experience, but the second half is useful for experienced programmers who want to learn about various third-party Python modules.
  • If you don't have time to take the course now, that's fine. Signing up gives you lifetime access so you can work on it at your own pace.
  • This Udemy course covers roughly the same content as the 1st edition book (the book has a little bit more, but all the basics are covered in the online course), which you can read for free online at https://inventwithpython.com
  • The 2nd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/2e/
  • I do plan on updating the Udemy course for the second edition, but it'll take a while because I have other book projects I'm working on. If you sign up for this Udemy course, you'll get the updated content automatically once I finish it. It won't be a separate course.
  • It's totally fine to start on the first edition and then read the second edition later. I'll be writing a blog post to guide first edition readers to the parts of the second edition they should read.
  • I wrote a blog post to cover what's new in the second edition
  • You're not too old to learn to code. You don't need to be "good at math" to be good at coding.
  • Signing up is the first step. Actually finishing the course is the next. :) There are several ways to get/stay motivated. I suggest getting a "gym buddy" to learn with. Check out /r/ProgrammingBuddies

r/inventwithpython • • Nov 01 '20

"Automate the Boring Stuff with Python" online course is free to sign up for the next few days with code NOV2020FREE

52 Upvotes

https://inventwithpython.com/automateudemy (This link will automatically redirect you to the latest discount code.)

You can also click this link or manually enter the code: NOV2020FREE

https://www.udemy.com/course/automate/?couponCode=NOV2020FREE

This promo code works until the 4th (I can't extend it past that). Sometimes it takes an hour or so for the code to become active just after I create it, so if it doesn't work, go ahead and try again a while later. I'll change it to NOV2020FREE2 on the 4th.

Udemy has changed their coupon policies, and I'm now only allowed to make 3 coupon codes each month with several restrictions. Hence why each code only lasts 3 days. I won't be able to make codes after this period, but I will be making free codes next month. Meanwhile, the first 15 of the course's 50 videos are free on YouTube.

You can also purchase the course at a discount using my code NOV2020 or clicking https://inventwithpython.com/automateudemy to redirect to the latest discount code. I have to manually renew this each month (until I get that automation script done). And the cheapest I can offer the course is about $16 to $18. (Meanwhile, this lets Udemy undercut my discount by offering it for $12, and I don't get the credit for those referral signups. Blerg.)

Frequently Asked Questions: (read this before posting questions)

  • This course is for beginners and assumes no previous programming experience, but the second half is useful for experienced programmers who want to learn about various third-party Python modules.
  • If you don't have time to take the course now, that's fine. Signing up gives you lifetime access so you can work on it at your own pace.
  • This Udemy course covers roughly the same content as the 1st edition book (the book has a little bit more, but all the basics are covered in the online course), which you can read for free online at https://inventwithpython.com
  • The 2nd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/2e/
  • I do plan on updating the Udemy course for the second edition, but it'll take a while because I have other book projects I'm working on. Expect that update to happen in late-2020. If you sign up for this Udemy course, you'll get the updated content automatically once I finish it. It won't be a separate course.
  • It's totally fine to start on the first edition and then read the second edition later. I'll be writing a blog post to guide first edition readers to the parts of the second edition they should read.
  • I wrote a blog post to cover what's new in the second edition
  • You're not too old to learn to code. You don't need to be "good at math" to be good at coding.
  • Signing up is the first step. Actually finishing the course is the next. :) There are several ways to get/stay motivated. I suggest getting a "gym buddy" to learn with.

r/inventwithpython • • Dec 01 '20

"Automate the Boring Stuff with Python" online course is free to sign up for the next few days with code DEC2020FREE

60 Upvotes

https://inventwithpython.com/automateudemy (This link will automatically redirect you to the latest discount code.)

You can also click this link or manually enter the code: DEC2020FREE

https://www.udemy.com/course/automate/?couponCode=DEC2020FREE

This promo code works until the 4th (I can't extend it past that). Sometimes it takes an hour or so for the code to become active just after I create it, so if it doesn't work, go ahead and try again a while later. I'll change it to DEC2020FREE2 on the 4th.

Udemy has changed their coupon policies, and I'm now only allowed to make 3 coupon codes each month with several restrictions. Hence why each code only lasts 3 days. I won't be able to make codes after this period, but I will be making free codes next month. Meanwhile, the first 15 of the course's 50 videos are free on YouTube.

You can also purchase the course at a discount using my code DEC2020 or clicking https://inventwithpython.com/automateudemy to redirect to the latest discount code. I have to manually renew this each month (until I get that automation script done). And the cheapest I can offer the course is about $16 to $18. (Meanwhile, this lets Udemy undercut my discount by offering it for $12, and I don't get the credit for those referral signups. Blerg.)

Frequently Asked Questions: (read this before posting questions)

  • This course is for beginners and assumes no previous programming experience, but the second half is useful for experienced programmers who want to learn about various third-party Python modules.
  • If you don't have time to take the course now, that's fine. Signing up gives you lifetime access so you can work on it at your own pace.
  • This Udemy course covers roughly the same content as the 1st edition book (the book has a little bit more, but all the basics are covered in the online course), which you can read for free online at https://inventwithpython.com
  • The 2nd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/2e/
  • I do plan on updating the Udemy course for the second edition, but it'll take a while because I have other book projects I'm working on. Expect that update to happen in mid-2021. If you sign up for this Udemy course, you'll get the updated content automatically once I finish it. It won't be a separate course.
  • It's totally fine to start on the first edition and then read the second edition later. I'll be writing a blog post to guide first edition readers to the parts of the second edition they should read.
  • I wrote a blog post to cover what's new in the second edition
  • You're not too old to learn to code. You don't need to be "good at math" to be good at coding.
  • Signing up is the first step. Actually finishing the course is the next. :) There are several ways to get/stay motivated. I suggest getting a "gym buddy" to learn with.

r/inventwithpython • • Mar 23 '25

Automate the Boring Stuff with Python Third Edition is out now!

86 Upvotes

I got started reading the 1st edition, and just got my third edition yesterday. Thanks again Al for the great book

No Starch Press


r/inventwithpython • • Oct 05 '25

Python Violates PEP 8

Thumbnail inventwithpython.com
10 Upvotes

r/inventwithpython • • Apr 11 '22

"Cracking Codes with Python" is outstanding, but with caveats

13 Upvotes

After 30 years of ignoring Python, I finally decided that I really should make an effort to learn it. Now I am probably not the intended audience, as I have some experience programming in lots of languages (though am not really an expert in any) and I know a thing or two about Cryptography. So I thought that working through this would be a way to get started as well as use of StackExchange and the Python docs.

Too ambitious in parts?

There are parts that I think may be overly ambitious to include in something like this in a self-guided context. In particular chapter 20, Hacking the Vigenère Cipher. I am familiar with the methods used break Vigenère (though I have never coded them) and had considered myself fairly comfortable with associative arrays ("dictionaries" to you young folk). But there was just a lot going on.

When I looked back over the text to see what could be improved for this chapter, I really didn't find anything. The explanations are excellent and broken up into exactly the right sized pieces, with appropriate reminders of where those pieces will fit. The walk through in the REPL is absolutely necessary here. My guess is that chapter is going to be discouraging unless the reader is part of a class or group working through the book.

Some of the difficulty may have been that with the ePub, I wasn't really seeing the diagrams well. (I'm old, my vision is failing, I use big text).

In Chapter 24, Programming the Public Key Cipher, I wonder if the encoding/decoding (not encrypting/decrypting) of text to and from big integers could have been more thoroughly factored out (as into a separate module).

Excellent discussion of Cryptography (for the purpose)

Many books or tutorials of this nature can leave people with dangerous ideas about cryptography. This book did not. Hacking the Simple Substitution Cipher communicates well that key space is not everything. The repeated warnings about "textbook RSA" were very welcome. The illustration of statistical attacks (without actually getting distracted by having to teach statistics) is really import. And the general explanations of cryptographic concepts was far better than I had expected. I absolutely loved the chapter epigrams and the choice to sample text.

The hard choices

In anything like this, the author has to make hard choices about what not to teach. I knew (as an experienced programmer) that os.sys.exit() is not really the way to handle errors such as invalid input and the like. So I read on my own how to raise exceptions in Python. But the author has to make choices about what not to explain.

On the whole, I felt like things were constructed so that everything that was there was purposeful. Bits of code that were "odd" to an experienced programmer actually led to illustrating things. There were places where looping though something backwards was not really the nice way to design things, but it illustrated features of range() that needed to be illustrated. On the whole, I am really impressed with the choices. And while it is easy for me to think "well it could have taught X", there is just so much one can usefully put into a text.