r/inventwithpython • u/jpinoniemi • Mar 23 '25
Automate the Boring Stuff with Python Third Edition is out now!
I got started reading the 1st edition, and just got my third edition yesterday. Thanks again Al for the great book
r/inventwithpython • u/jpinoniemi • Mar 23 '25
I got started reading the 1st edition, and just got my third edition yesterday. Thanks again Al for the great book
r/inventwithpython • u/AlSweigart • Jun 27 '21
r/inventwithpython • u/AlSweigart • Jan 05 '26
This link redirects to a free sign up for the Automate The Boring Stuff With Python course on Udemy:
https://inventwithpython.com/automateudemy
This blog post discusses how you can otherwise get the course for free or at a discount.
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.
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 3rd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/3e/
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.
You're not too old to learn to code. You don't need to be "good at math" to be good at coding.
r/inventwithpython • u/AlSweigart • Dec 01 '20
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 • u/AlSweigart • Mar 17 '21
r/inventwithpython • u/AlSweigart • Oct 01 '20
r/inventwithpython • u/AlSweigart • Nov 04 '19
https://www.udemy.com/course/automate/?couponCode=NOV2019FREE
Udemy has changed their coupon policies, and I'm now only allowed to make 3 coupon codes each month with several restrictions. I'll no longer be able to make free coupon codes with arbitrary restrictions. Instead I can:
Make free codes that are only good for 3 days for an unlimited number of people (NOV2019FREE lasts until November 7, 2019 11:05 AM PST)
Make codes that make the course cheap (but not cheaper than what Udemy offers, allowing them to undercut me) for unlimited people that lasts for 30 days. (I've made a code NOV2019 for this.)
There's two other options, but they're less than ideal: free but only 10 people can use it, or lowest price but it's only good for a few days instead of a month. I can only make 3 codes a month, so I can't just generate new codes every few days.
If you're reading this post after the NOV2019FREE code, you can use the NOV2019 code to get the course for about $14. I plan on making new free codes for the first three days of each month. You can probably guess what next month's free code will be.
To head off any questions:
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 the same content as the book, which you can read for free online at https://inventwithpython.com
The 2nd edition of Automate the Boring Stuff with Python will be posted on the website in mid-November. It gets released on the 12th, and I'll need a couple days to format it to HTML and make it look nice.
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- or 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
I used to do free codes once or twice a year. The last time I did, I had an amazing 80,000 people sign up (so a dozen of them might have actually finished the course, if people are as good as I am about finishing the online courses I sign up for). Udemy's new policies mean I can't do this anymore. I find this to be a less than ideal situation. So I'm rolling out new codes each month. NOV2019FREE is the free code, and NOV2019 is the cheap code. I'll come out with new ones at the start of each month. (And yes, I'll probably write a script to automate this.)
r/inventwithpython • u/AlSweigart • Dec 02 '19
You can use this code to sign up for the Udemy "Automate the Boring Stuff with Python" course for free:
https://www.udemy.com/course/automate/?couponCode=DEC2019FREE
(If DEC2019FREE doesn't work, try it again in a few minutes.)
During the month of December, you can also use DEC2019 to sign up for $14 instead of the usual $50: https://www.udemy.com/course/automate/?couponCode=DEC2019
(Due to the way Udemy now does promotions, I'm limited in how many discount codes I can make each month, so there's no way for me to make more after the 72 hour period, which ends roughly Wednesday night 7pm Pacific time.)
r/inventwithpython • u/AlSweigart • Mar 03 '21
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: MAR2021FREE
https://www.udemy.com/course/automate/?couponCode=MAR2021FREE
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 MAR2021FREE2 in three days.
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 JAN2021CODE or FEB2021CODE (try both if one doesn't work) 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. Check out /r/ProgrammingBuddies
r/inventwithpython • u/AlSweigart • Feb 01 '21
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: FEB2021FREE
https://www.udemy.com/course/automate/?couponCode=FEB2021FREE
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 FEB2021FREE2 in three days.
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 JAN2021CODE or FEB2021CODE (try both if one doesn't work) 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 • u/AlSweigart • Dec 31 '19
r/inventwithpython • u/AlSweigart • Nov 01 '20
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 • u/AlSweigart • Jul 01 '21
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: JUL2021FREE
https://www.udemy.com/course/automate/?couponCode=JUL2021FREE
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 JUL2021FREE2 in three days.
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.
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 • u/AlSweigart • May 12 '21
I'm a bit late with this month's free code, but it is now active.
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: MAY2021FREE
https://www.udemy.com/course/automate/?couponCode=MAY2021FREE
This promo code works for three days (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 MAY2021FREE2 in three days.
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.
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. Check out /r/ProgrammingBuddies
r/inventwithpython • u/AlSweigart • Apr 01 '21
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: APR2021FREE
https://www.udemy.com/course/automate/?couponCode=APR2021FREE
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 APR2021FREE2 in three days.
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.
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. Check out /r/ProgrammingBuddies
r/inventwithpython • u/AlSweigart • Jun 01 '22
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 • u/AlSweigart • Jan 06 '21
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: JAN2021FREE
https://www.udemy.com/course/automate/?couponCode=JAN2021FREE
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 JAN2021FREE2 in three days.
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 JAN2021CODE 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 • u/AlSweigart • Jun 03 '21
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: JUN2021FREE
https://www.udemy.com/course/automate/?couponCode=JUN2021FREE
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 JUN2021FREE2 in three days.
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.
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 or late-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. Check out /r/ProgrammingBuddies
r/inventwithpython • u/AlSweigart • Sep 05 '22
NOTE: The codes are all used up. But you can watch the first 15 of the 50 videos for free on YouTube. If you want to buy the rest of the course, the https://inventwithpython.com/automateudemy link redirects to a discount code that lowers the price to $13. The course follows the info in the book, which is for free in full at https://automatetheboringstuff.com/
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):
https:// udemy. com/course/automate/?couponCode=SEP2022FREE
https:// udemy. com/course/automate/?couponCode=SEP2022FREE2
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 • u/AlSweigart • Sep 01 '20
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: SEP2020FREE
https://www.udemy.com/course/automate/?couponCode=SEP2020FREE
This promo code works until September 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 SEP2020FREE2 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 SEP2020FREE 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 • u/JoseALerma • Jul 13 '18
I don't expect to find many more, but I'll update this post if I do.
Note: It's an EPUB copy, published: 2016-01-14T10:12:21-08:00 Also, no page numbers, just reference numbers (refNum/949).
In Chapter 10, on reference number 368.7, paragraph 19.30, the code block:
>>> podBayDoorStatus = 'open'
>>> assert podBayDoorStatus == 'open', 'The pod bay doors need to be "open".'
>>> podBayDoorStatus = 'I\'m sorry, Dave. I\'m afraid I can't do that.''
>>> assert podBayDoorStatus == 'open', 'The pod bay doors need to be "open".'should be:
>>> podBayDoorStatus = 'open'
>>> assert podBayDoorStatus == 'open', 'The pod bay doors need to be "open".'
>>> podBayDoorStatus = 'I\'m sorry, Dave. I\'m afraid I can\'t do that.' # Changed
>>> assert podBayDoorStatus == 'open', 'The pod bay doors need to be "open".'In Chapter 11, on reference number 447.4, paragraph 20.247, the code block:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://inventwithpython.com')
try:
elem = browser.find_element_by_class_name('bookcover')
print('Found <%s> element with that class name!' % (elem.tag_name))
except:
print('Was not able to find an element with that name.')outputs Was not able to find an element with that name.
The following does give the intended output:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://inventwithpython.com')
try:
elem = browser.find_element_by_class_name('card-img-top') # changed
print('Found <%s> element with that class name!' % (elem.tag_name))
except:
print('Was not able to find an element with that name.')On reference number 448.7, paragraph 20.249, the code block:
>>> from selenium import webdriver
>>> browser = webdriver.Firefox()
>>> browser.get('http://inventwithpython.com')
>>> linkElem = browser.find_element_by_link_text('Read It Online')
>>> type(linkElem)
<class 'selenium.webdriver.remote.webelement.WebElement'>
>>> linkElem.click() # follows the "Read It Online" linkshould be:
>>> from selenium import webdriver
>>> browser = webdriver.Firefox()
>>> browser.get('http://inventwithpython.com')
>>> linkElem = browser.find_element_by_link_text('Read Online for Free') # changed
>>> type(linkElem)
<class 'selenium.webdriver.remote.webelement.WebElement'>
>>> linkElem.click() # follows the "Read Online for Free" link # changedOn reference number 449.3, paragraph 20.252, the line:
As long as Gmail hasn’t changed the id of the Username and Password text fields since this book was published...
"Gmail" should be "Yahoo Mail" because of line >>> browser.get('https://mail.yahoo.com') in the code block
In Chapter 12, on reference number 459.8, paragraph 21.47, the codeblock:
>>> wb.get_sheet_names()
['Sheet1', 'Sheet2', 'Sheet3']
>>> sheet = wb.get_sheet_by_name('Sheet3')
>>> sheet
<Worksheet "Sheet3">
>>> type(sheet) <class 'openpyxl.worksheet.worksheet.Worksheet'>
>>> sheet.title
'Sheet3'
>>> anotherSheet = wb.get_active_sheet()should be:
>>> wb.sheetnames # changed
['Sheet1', 'Sheet2', 'Sheet3']
>>> sheet = wb['Sheet3'] # changed
>>> sheet
<Worksheet "Sheet3">
>>> type(sheet) <class 'openpyxl.worksheet.worksheet.Worksheet'>
>>> sheet.title
'Sheet3'
>>> anotherSheet = wb.active # changedbecause those methods are now depreciated (using OpenPyXL 2.5.5).
In Chapter 12, on reference number 463.0, paragraph 21.56, the codeblock:
>>> sheet = wb.get_sheet_by_name('Sheet1')
>>> sheet.get_highest_row()
7
>>> sheet.get_highest_column()
3should be:
>>> sheet = wb['Sheet1'] # changed
>>> sheet.max_row # changed
7
>>> sheet.max_column # changed
3because those methods are also depreciated.
On reference number 463.6, paragraph 21.58, the codeblock:
>>> from openpyxl.cell import get_column_letter, column_index_from_string
--snip-- # omitted to save space
>>> sheet = wb.get_sheet_by_name('Sheet1')
>>> get_column_letter(sheet.get_highest_column())
'C'should be:
>>> from openpyxl.utils import get_column_letter, column_index_from_string # changed
--snip-- # omitted to save space
>>> sheet = wb['Sheet1'] # changed
>>> get_column_letter(sheet.max_column) # changed
'C'because the functions were relocated and methods depreciated. The lines with openpyxl.cell in the paragraphs above and below should also be changed. In paragraph 21.59, the line "method like get_highest_column() to get an integer" should be changed to "property like max_column to get an integer."
In Chapter 12, on reference number 465.0, paragraph 21.60 is another >>> sheet = wb.get_sheet_by_name('Sheet1') that ought to be >>> sheet = wb['Sheet1'].
On reference number 466.8, paragraph 21.64, the codeblock:
--snip-- # omitted to save space
>>> sheet = wb.get_active_sheet()
>>> sheet.columns[1]
(<Cell Sheet1.B1>, <Cell Sheet1.B2>, <Cell Sheet1.B3>, <Cell Sheet1.B4>,
<Cell Sheet1.B5>, <Cell Sheet1.B6>, <Cell Sheet1.B7>)
>>> for cellObj in sheet.columns[1]:
print(cellObj.value)outputs TypeError: 'generator' object is not subscriptable
The best way to fix it is debatable, but the easiest was to use the list function:
--snip-- # omitted to save space
>>> sheet = wb.active # changed
>>> list(sheet.columns)[1] # changed
(<Cell Sheet1.B1>, <Cell Sheet1.B2>, <Cell Sheet1.B3>, <Cell Sheet1.B4>,
<Cell Sheet1.B5>, <Cell Sheet1.B6>, <Cell Sheet1.B7>)
>>> for cellObj in list(sheet.columns)[1]: # changed
print(cellObj.value)On reference number 468.0, paragraph 21.67 the list item 4. Call the get_active_sheet() or get_sheet_by_name() workbook method. ought to be something like 4. Use the .active property or the ["UseThisSheet"] workbook key.
On reference number 470.6, paragraph 21.90 the codeblock:
--snip-- # omitted to save space
➌ sheet = wb.get_sheet_by_name('Population by Census Tract')
countyData = {}
# TODO: Fill in countyData with each county's population and tracts.
print('Reading rows...')
➍ for row in range(2, sheet.get_highest_row() + 1):
--snip-- # omitted to save spaceought to be:
--snip-- # omitted to save space
➌ sheet = wb['Population by Census Tract'] # changed
countyData = {}
# TODO: Fill in countyData with each county's population and tracts.
print('Reading rows...')
➍ for row in range(2, sheet.max_row + 1): # changedbecause of depreciated methods. The codeblock on paragraph 21.96 ought to be updated as well.
In Chapter 12, on reference number 477.4, paragraph 21.111, the codeblock:
>>> wb.get_sheet_names()
['Sheet']
>>> sheet = wb.get_active_sheet()
>>> sheet.title
'Sheet'
>>> sheet.title = 'Spam Bacon Eggs Sheet'
>>> wb.get_sheet_names()ought to be:
>>> wb.sheetnames # changed
['Sheet']
>>> sheet = wb.active # changed
>>> sheet.title
'Sheet'
>>> sheet.title = 'Spam Bacon Eggs Sheet'
>>> wb.sheetnames # changedIn paragraph 21.113 (codeblock directly below) another >>> sheet = wb.get_active_sheet() ought to be >>> sheet = wb.active.
On reference number 478.6, paragraph 21.116, the codeblock:
>>> wb.get_sheet_names()
['Sheet']
>>> wb.create_sheet()
<Worksheet "Sheet1">
>>> wb.get_sheet_names()
['Sheet', 'Sheet1']
>>> wb.create_sheet(index=0, title='First Sheet')
<Worksheet "First Sheet">
>>> wb.get_sheet_names()
['First Sheet', 'Sheet', 'Sheet1']
>>> wb.create_sheet(index=2, title='Middle Sheet')
<Worksheet "Middle Sheet">
>>> wb.get_sheet_names()
['First Sheet', 'Sheet', 'Middle Sheet', 'Sheet1']ought to be:
>>> wb.sheetnames # changed
['Sheet']
>>> wb.create_sheet()
<Worksheet "Sheet1">
>>> wb.sheetnames # changed
['Sheet', 'Sheet1']
>>> wb.create_sheet(index=0, title='First Sheet')
<Worksheet "First Sheet">
>>> wb.sheetnames # changed
['First Sheet', 'Sheet', 'Sheet1']
>>> wb.create_sheet(index=2, title='Middle Sheet')
<Worksheet "Middle Sheet">
>>> wb.sheetnames # changedIn paragraph 21.118 (codeblock directly below):
>>> wb.get_sheet_names()
['First Sheet', 'Sheet', 'Middle Sheet', 'Sheet1']
>>> wb.remove_sheet(wb.get_sheet_by_name('Middle Sheet'))
>>> wb.remove_sheet(wb.get_sheet_by_name('Sheet1'))
>>> wb.get_sheet_names()ought to be
>>> wb.sheetnames # changed
['First Sheet', 'Sheet', 'Middle Sheet', 'Sheet1']
>>> wb.remove(wb['Middle Sheet']) # changed
>>> wb.remove(wb['Sheet1']) # changed
>>> wb.sheetnames # changedIn paragraph 21.121 (codeblock directly below), and on reference number 483.6, paragraph 21.144 (updateProduce.py) are more >>> sheet = wb.get_sheet_by_name('Sheet') that should be >>> sheet = wb['Sheet'].
On reference number 484.8, paragraph 21.146 (updateProduce.py), the line ➊ for rowNum in range(2, sheet.get_highest_row()): # skip the first row ought to be ➊ for rowNum in range(2, sheet.max_row): # skip the first row.
On reference number 486.5, paragraph 21.158, the line:
To customize font styles in cells, important, import the Font() and Style() functions from the openpyxl.styles module.
Unless, of course, that's an intended pun.
On reference number 486.8, paragraph 21.158, the codeblock:
>>> import openpyxl
>>> from openpyxl.styles import Font, Style
>>> wb = openpyxl.Workbook()
>>> sheet = wb.get_sheet_by_name('Sheet')
➊ >>> italic24Font = Font(size=24, italic=True)
➋ >>> styleObj = Style(font=italic24Font)
➌ >>> sheet['A1'].style = styleObj
>>> sheet['A1'] = 'Hello world!'
>>> wb.save('styled.xlsx')should be:
>>> import openpyxl
>>> from openpyxl.styles import Font, NamedStyle # changed
>>> wb = openpyxl.Workbook()
>>> sheet = wb['Sheet'] # changed
➊ >>> italic24Font = NamedStyle(name="italic24Font") # changed
➋ >>> italic24Font.font = Font(size=24, italic=True) # changed
➌ >>> sheet['A1'].style = italic24Font # changed
>>> sheet['A1'] = 'Hello world!'
>>> wb.save('styled.xlsx')because the Style class is now depreciated.
In Chapter 12, on reference number 488.9, paragraph 21.178, the codeblock:
>>> import openpyxl
>>> from openpyxl.styles import Font, Style
>>> wb = openpyxl.Workbook()
>>> sheet = wb.get_sheet_by_name('Sheet')
>>> fontObj1 = Font(name='Times New Roman', bold=True)
>>> styleObj1 = Style(font=fontObj1)
>>> sheet['A1'].style/styleObj
>>> sheet['A1'] = 'Bold Times New Roman'
>>> fontObj2 = Font(size=24, italic=True)
>>> styleObj2 = Style(font=fontObj2)
>>> sheet['B3'].style/styleObj
>>> sheet['B3'] = '24 pt Italic'
>>> wb.save('styles.xlsx')should be:
>>> import openpyxl
>>> from openpyxl.styles import Font, NamedStyle # changed
>>> wb = openpyxl.Workbook()
>>> sheet = wb['Sheet'] # changed
>>> fontObj1 = Font(name='Times New Roman', bold=True)
>>> styleObj1 = NamedStyle(name="styleObj1") # changed
>>> styleObj1.font = fontObj1 # added
>>> sheet['A1'].style = styleObj1 # changed
>>> sheet['A1'] = 'Bold Times New Roman'
>>> fontObj2 = Font(size=24, italic=True)
>>> styleObj2 = NamedStyle(name="StyleObj2") # changed
>>> styleObj2.font = fontObj2 # added
>>> sheet['B3'].style = styleObj2 # changed
>>> sheet['B3'] = '24 pt Italic'
>>> wb.save('styles.xlsx')In Chapter 12, reference number 491.5, paragraphs 21.185 and 21.187 are more >>> sheet = wb.get_active_sheet() that should be >>> sheet = wb.active. However, the formula evaluation doesn't work for me:
>>> import openpyxl
>>> wbFormulas = openpyxl.load_workbook('writeFormula.xlsx')
>>> sheet = wbFormulas.active # changed
>>> sheet['A3'].value
'=SUM(A1:A2)'
>>> wbDataOnly = openpyxl.load_workbook('writeFormula.xlsx', data_only=True)
>>> sheet = wbDataOnly.active # changed
>>> sheet['A3'].value # not working with LibreOffice 6.0.3.2
500From what I've researched on openpyxl.load_workbook(),
data_only controls whether cells with formulae have either the formula (default) or the value stored the last time Excel read the sheet.
TODO: can someone else confirm with another LibreOffice version?
Reference numbers 493.3, 495.0, 496.2, and 497.6 have more >>> sheet = wb.get_active_sheet() that should be >>> sheet = wb.active.
In Chapter 12, reference number 500.4, paragraph 21.234, the codeblock:
>>> import openpyxl
>>> wb = openpyxl.Workbook()
>>> sheet = wb.get_active_sheet()
>>> for i in range(1, 11): # create some data in column A
sheet['A' + str(i)] = i
>>> refObj = openpyxl.charts.Reference(sheet, (1, 1), (10, 1))
>>> seriesObj = openpyxl.charts.Series(refObj, title='First series')
>>> chartObj = openpyxl.charts.BarChart()
>>> chartObj.append(seriesObj)
>>> chartObj.drawing.top = 50 # set the position
>>> chartObj.drawing.left = 100
>>> chartObj.drawing.width = 300 # set the size
>>> chartObj.drawing.height = 200
>>> sheet.add_chart(chartObj)
>>> wb.save('sampleChart.xlsx')works slightly better as:
>>> import openpyxl
>>> wb = openpyxl.Workbook()
>>> sheet = wb.active # changed
>>> for i in range(1, 11): # create some data in column A
sheet['A' + str(i)] = i
>>> refObj = openpyxl.chart.Reference(sheet, min_row=1, min_col=1, max_row=10, max_col=1) # changed
>>> seriesObj = openpyxl.chart.Series(refObj, title='First series') # changed FIXME: Chart layout is wrong (LibreOffice 6.0.3.2)
>>> chartObj = openpyxl.chart.BarChart() # changed
>>> chartObj.append(seriesObj)
>>> chartObj.anchor = "B3" # set the position; changed
>>> chartObj.width = 7.94 # set the size (in centimeters, where 1 cm = 37.8 pixels); changed
>>> chartObj.height = 5.29 # changed
>>> sheet.add_chart(chartObj)
>>> wb.save('sampleChart.xlsx')but the layout of the chart is all wrong. TODO: can someone else confirm it works in Excel?
In Chapter 13 (I made it! Woot!), reference number 511.7, paragraph 22.13, the line:
PyPDF2 uses a zero-based index for getting pages: The first page is page 0, the second is Introduction, and so on.
"Introduction" links to the introduction of the book. Maybe "page 1" was auto-referenced?
On reference number 513.2, paragraph 22.15, the codeblock:
➌ >>> pdfReader.decrypt('rosebud')
1
>>> pageObj = pdfReader.getPage(0)gave me an IndexError, but the following works:
>>> pdfReader = PyPDF2.PdfFileReader(open("encrypted.pdf", "rb")) # added
➌ >>> pdfReader.decrypt('rosebud')
1
>>> pageObj = pdfReader.getPage(0)In Chapter 13, reference number 524.8, paragraph 22.60, the codeblock:
#! python3
# combinePdfs.py - Combines all the PDFs in the current working directory into
# into a single PDF
import PyPDF2, os
# Get all the PDF filenames.
pdfFiles = []
for filename in os.listdir('.'):
if filename.endswith('.pdf'):
➋ pdfFiles.append(filename)
➌ pdfFiles.sort(key = str.lower)should be:
#! python3
# combinePdfs.py - Combines all the PDFs in the current working directory into
# a single PDF # changed
import PyPDF2, os
# Get all the PDF filenames.
pdfFiles = []
for filename in os.listdir('.'):
if filename.endswith('.pdf'):
➋ pdfFiles.append(filename)
➌ pdfFiles.sort(key=str.lower) # changedIn Chapter 13, reference number 531.0, paragraph 22.79, the codeblock:
➎ >>> len(doc.paragraphs[1].runs)
4
➏ >>> doc.paragraphs[1].runs[0].text
'A plain paragraph with some '
➐ >>> doc.paragraphs[1].runs[1].text
'bold'
➑ >>> doc.paragraphs[1].runs[2].text
' and some '
➒ >>> doc.paragraphs[1].runs[3].text
'italic'outputs the following in LibreOffice 6.0.3.2 with Python-Docx 0.8.7:
➎ >>> len(doc.paragraphs[1].runs)
5 # changed
➏ >>> doc.paragraphs[1].runs[0].text
'A plain paragraph with' # changed
➐ >>> doc.paragraphs[1].runs[1].text
' some ' # changed
➑ >>> doc.paragraphs[1].runs[2].text
'bold' # changed
➒ >>> doc.paragraphs[1].runs[3].text
' and some ' # changed
>>> doc.paragraphs[1].runs[4].text # added
'italic'TODO: can someone confirm in Word on Windows?
On reference number 540.1, paragraph 22.163, the codeblock:
--snip-- # omitted to save space
>>> doc.paragraphs[1].runs[0].style = 'QuoteChar'
>>> doc.paragraphs[1].runs[1].underline = True
>>> doc.paragraphs[1].runs[3].underline = True
>>> doc.save('restyled.docx')gives a UserWarning: style lookup by style_id is deprecated. Use style name as key instead. return self._get_style_id_from_style(self[style_name], style_type) but the following fixes it:
--snip-- # omitted to save space
>>> doc.paragraphs[1].runs[0].style = 'Quote Char' # changed for python-docx 0.8.7
>>> doc.paragraphs[1].runs[1].underline = True
>>> doc.paragraphs[1].runs[3].underline = True
>>> doc.save('restyled.docx')In Chapter 13, reference number 540.1, paragraph 22.164, the line:
We can see that it’s simple to divide a paragraph into runs and access each run individiaully.
On reference number 546.9, paragraph 22.183, the codeblock:
➊ >>> doc.paragraphs[0].runs[0].add_break(docx.text.WD_BREAK.PAGE)
>>> doc.add_paragraph('This is on the second page!')
<docx.text.Paragraph object at 0x00000000037855F8>
>>> doc.save('twoPage.docx')ought to be:
➊ >>> doc.paragraphs[0].runs[0].add_break(docx.enum.text.WD_BREAK.PAGE) # changed
>>> doc.add_paragraph('This is on the second page!')
<docx.text.Paragraph object at 0x00000000037855F8>
>>> doc.save('twoPage.docx')In Chapter 13, reference number 552.0, paragraph 22.228, the line:
You should try both the uppercase and lower-case form of each word.
In Chapter 14, reference number 561.2, paragraph 23.33, the codeblock:
>>> import csv
>>> csvFile = open('example.tsv', 'w', newline='')
➊ >>> csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
>>> csvWriter.writerow(['apples', 'oranges', 'grapes'])
24
>>> csvWriter.writerow(['eggs', 'bacon', 'ham'])
17
>>> csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam'])
32outputs:
>>> import csv
>>> csvFile = open('example.tsv', 'w', newline='')
➊ >>> csvWriter = csv.writer(csvFile, delimiter='\t', lineterminator='\n\n')
>>> csvWriter.writerow(['apples', 'oranges', 'grapes'])
23 # changed
>>> csvWriter.writerow(['eggs', 'bacon', 'ham'])
16 # changed
>>> csvWriter.writerow(['spam', 'spam', 'spam', 'spam', 'spam', 'spam'])
31 # changedIn Chapter 14, reference number 565.5, paragraph 23.54, the codeblock:
#! python3
# removeCsvHeader.py - Removes the header from all CSV files in the current
# working directory.
--snip--
# Read the CSV file in (skipping first row).
csvRows = []
csvFileObj = open(csvFilename)
readerObj = csv.reader(csvFileObj)
for row in readerObj:
if readerObj.line_num == 1:
continue # skip first row
csvRows.append(row)
csvFileObj.close()
# TODO: Write out the CSV file.needs to be indented to match the previous codeblock:
#! python3
# removeCsvHeader.py - Removes the header from all CSV files in the current
# working directory.
--snip--
print('Removing header from ' + csvFilename + '...') # added
# Read the CSV file in (skipping first row).
csvRows = []
csvFileObj = open(csvFilename)
readerObj = csv.reader(csvFileObj)
for row in readerObj:
if readerObj.line_num == 1:
continue # skip first row
csvRows.append(row)
csvFileObj.close()
# TODO: Write out the CSV file.On reference number 568.2, paragraph 23.58:
The CSV Writer object will write the list to a CSV file in headerRemoved using csvFilename (which we also used in the CSV reader). This will overwrite the original file.
I thought the original file won't be overwritten because the new file is in the headerRemoved folder? TODO: Can someone please confirm?
On reference number 575.4, paragraph 23.98, the link http://api.openweathermap.org /data/2.5/forecast/daily?q=%3CLocation%3E&cnt=3 no longer works. The OpenWeatherMap.org API now needs an API key. So, sign up if you really want to run quickWeather.py.
Alternatively, the Weather.gov API (United States only, at the moment) does not require an API key (only a User Agent), but it will require one in the future.
I have a working solution using the new API, uploaded to pastebin to save space: https://pastebin.com/yVGNRk62. Chapter 15 explains the datetime module more.
In Chapter 14, reference number 582.0, paragraph 23.130, the codeblock:
for excelFile in os.listdir('.'):
# Skip non-xlsx files, load the workbook object.
for sheetName in wb.get_sheet_names():
# Loop through every sheet in the workbook.
sheet = wb.get_sheet_by_name(sheetName)
# Create the CSV filename from the Excel filename and sheet title.
# Create the csv.writer object for this CSV file.
# Loop through every row in the sheet.
for rowNum in range(1, sheet.get_highest_row() + 1):
rowData = [] # append each cell to this list
# Loop through each cell in the row.
for colNum in range(1, sheet.get_highest_column() + 1):
# Append each cell's data to rowData.
# Write the rowData list to the CSV file.
csvFile.close()should be:
for excelFile in os.listdir('.'):
# Skip non-xlsx files, load the workbook object.
for sheetName in wb.sheetnames: # changed
# Loop through every sheet in the workbook.
sheet = wb[sheetName] # changed
# Create the CSV filename from the Excel filename and sheet title.
# Create the csv.writer object for this CSV file.
# Loop through every row in the sheet.
for rowNum in range(1, sheet.max_row + 1): # changed
rowData = [] # append each cell to this list
# Loop through each cell in the row.
for colNum in range(1, sheet.max_column + 1): # changed
# Append each cell's data to rowData.
# Write the rowData list to the CSV file.
csvFile.close()Well, darn my socks. The excelSpreadsheets.zip file in https://www.nostarch.com/download/Automate_the_Boring_Stuff_onlinematerials.zip contains .csv files, so they cannot be converted to .csv. (Sept. 10, 2018 Update: got e-mail confirming zip file has been replaced with Excel spreadsheets. Though, when I check it, it still has .csv files, so YMMV.) (Oct. 3, 2018 Update: new zip file at https://nostarch.com/download/Automate_the_Boring_Stuff_onlinematerials_v.2.zip)
In Chapter 15, reference number 595.7, paragraph 24.42, the codeblock:
>>> datetime.datetime.fromtimestamp(1000000)
datetime.datetime(1970, 1, 12, 5, 46, 40)
>>> datetime.datetime.fromtimestamp(time.time())
datetime.datetime(2015, 2, 27, 11, 13, 0, 604980)might need to be:
>>> import time # added
>>> datetime.datetime.fromtimestamp(1000000)
datetime.datetime(1970, 1, 12, 5, 46, 40)
>>> datetime.datetime.fromtimestamp(time.time())
datetime.datetime(2015, 2, 27, 11, 13, 0, 604980)In case IDLE was closed to write the stopwatch.py program.
In Chapter 15, reference number 598.0, paragraph 24.47, the str line in codeblock needs bolding:
--snip-- # omitted to save space
>>> str(delta) # bold me, pls
'11 days, 10:09:08'On reference number 599.5, paragraph 24.49, the line:
Finally, passing the timedelta object to str() returns a string clearly explaning the duration.
In Chapter 15, reference number 612.3, paragraph 24.125, the line:
To make sure the keyword argument sep=' & ' gets passed to print() in the new thread, we pass kwargs={'sep': '& '} to threading.Thread().
On reference number 616.0, paragraph 24.136 (multidownloadXkcd.py), the codeblock:
--snip-- # omitted
if comicElem == []:
print('Could not find comic image.')
else:
➐ comicUrl = comicElem[0].get('src')
# Download the image.
print('Downloading image %s...' % (comicUrl))
--snip-- # omittedshould be:
--snip-- # omitted
if comicElem == []:
print('Could not find comic image.')
else:
➐ comicUrl = 'http:' + comicElem[0].get('src') # changed
# Download the image.
print('Downloading image %s...' % (comicUrl))
--snip-- # omittedOn reference number 627.6, paragraph 24.161, the codeblock:
>>> subprocess.Popen(['C:\\python34\\python.exe', 'hello.py'])
<subprocess.Popen object at 0x000000000331CF28>might need to be:
>>> subprocess.Popen(['C:\\python34\\python.exe', 'hello.py']).communicate() # changed
<subprocess.Popen object at 0x000000000331CF28>I could not get it to accept input without it in Ubuntu 18.04. TODO: Can someone confirm they got it to work in Windows?
In Chapter 15, reference number 631.7, paragraph 24.183 (countdown.py), the codeblock:
--snip-- # omitted
➊ timeLeft = 60
while timeLeft > 0:
➋ print(timeLeft, end='')
➌ time.sleep(1)
--snip-- # omittedmay need to be:
--snip-- # omitted
➊ timeLeft = 60
while timeLeft > 0:
➋ print(timeLeft) # changed
➌ time.sleep(1)
--snip-- # omittedIt wouldn't print remaining time in Python 3.6.5 (Ubuntu 18.04) until the while loop finished. It seemed to wait until the line was done before printing it. TODO: Can someone else please confirm?
In Chapter 16, reference number 648.4, paragraph 25.52, the line:
Install imapclient and pyzmail from a Terminal window. Appendix A has steps on how to install third-party modules.
I had to install pyzmail36 (possibly because I'm using Python 3.6.5). Appendix A may have to be updated.
In Chapter 16, reference number 658.7, paragraph 25.115, the lines:
imapObj.search(['ON 05-Jul-2015']). Returns every message sent on July 5, 2015.
imapObj.search(['SINCE 01-Jan-2015', 'BEFORE 01-Feb-2015', 'UNSEEN']). Returns every message sent in January 2015 that is unread. (Note that this means on and after January 1 and up to but not including February 1.)
imapObj.search(['SINCE 01-Jan-2015', 'FROM [email protected]']). Returns every message from [email protected] sent since the start of 2015.
imapObj.search(['SINCE 01-Jan-2015', 'NOT FROM [email protected]']). Returns every message sent from everyone except [email protected] since the start of 2015.
imapObj.search(['OR FROM [email protected] FROM [email protected]']). Returns every message ever sent from [email protected] or [email protected].
imapObj.search(['FROM [email protected]', 'FROM [email protected]']). Trick example! This search will never return any messages, because messages must match all search keywords. Since there can be only one “from” address, it is impossible for a message to be from both [email protected] and [email protected].should be:
imapObj.search(['ON', '05-Jul-2015']). Returns every message sent on July 5, 2015.
imapObj.search(['SINCE', '01-Jan-2015', 'BEFORE', '01-Feb-2015', 'UNSEEN']). Returns every message sent in January 2015 that is unread. (Note that this means on and after January 1 and up to but not including February 1.)
imapObj.search(['SINCE', '01-Jan-2015', 'FROM', '[email protected]']). Returns every message from [email protected] sent since the start of 2015.
imapObj.search(['SINCE', '01-Jan-2015', 'NOT', 'FROM', '[email protected]']). Returns every message sent from everyone except [email protected] since the start of 2015.
imapObj.search(['OR', 'FROM', '[email protected]', 'FROM', '[email protected]']). Returns every message ever sent from [email protected] or [email protected].
imapObj.search(['FROM', '[email protected]', 'FROM', '[email protected]']). Trick example! This search will never return any messages, because messages must match all search keywords. Since there can be only one “from” address, it is impossible for a message to be from both [email protected] and [email protected].because criteria should be a sequence of items. Plus, trying imapObj.search(['SINCE 01-Jan-2015', 'NOT FROM [email protected]']) outputs imaplib.error: SEARCH command error: BAD [b'Error in IMAP command UID SEARCH: Unexpected string as search key: SINCE 01-Jan-2015 (0.001 + 0.088 + 0.087 secs).']
Alternatively, imapObj.search('SINCE "01-Jan-2015" NOT FROM "[email protected]"') works, but isn't recommended according to the docs.
On reference number 664.6, paragraph 25.141, the line >>> message = pyzmail.PyzMessage.factory(rawMessages[40041]['BODY[]']) gave me a KeyError (even after using proper UIDs) that was only fixed by changing it to >>> message = pyzmail.PyzMessage.factory(rawMessages[40041][b'BODY[]'])
On reference number 668.9, paragraph 25.148, the line ➋ >>> UIDs = imapObj.search(['ON 09-Jul-2015']) should be ➋ >>> UIDs = imapObj.search(['ON', '09-Jul-2015'])
In Chapter 16, reference number 674.0, paragraph 25.168 (sendDuesReminders.py), the codeblock:
import openpyxl, smtplib, sys
--snip-- # omitted
➋ sheet = wb.get_sheet_by_name('Sheet1')
➌ lastCol = sheet.get_highest_column()
➍ latestMonth = sheet.cell(row=1, column=lastCol).value
--snip-- # omittedshould be:
import openpyxl, smtplib, sys, datetime # changed
--snip-- # omitted
➋ sheet = wb['Sheet1'] # changed
➌ lastCol = sheet.max_column # changed
➍ latestMonth = sheet.cell(row=1, column=lastCol).value
latestMonth = datetime.datetime.strftime(latestMonth, '%b %Y') # added for LibreOffice 6.0.3.2
--snip-- # omittedSept. 17, 2018 Update: In LibreOffice, latestMonth = 2018-06-01 00:00:00, so I had to use datetime to format it as Jun 2018. TODO: Can someone please confirm it works in Excel?
On reference number 676.3, paragraph 25.170, the line ➊ for r in range(2, sheet.get_highest_row() + 1): should be ➊ for r in range(2, sheet.max_row + 1):
On reference number 678.1, paragraph 25.174, the line body = "Subject: %s dues unpaid.\nDear %s,\nRecords show that you have not paid dues for %s. Please make this payment as soon as possible. Thank you!'" % (latestMonth, name, latestMonth) should be body = "Subject: %s dues unpaid.\nDear %s,\nRecords show that you have not paid dues for %s. Please make this payment as soon as possible. Thank you!" % (latestMonth, name, latestMonth)
In Chapter 16, reference number 682.8, paragraph 25.190, the codeblock:
➊ >>> from twilio.rest import TwilioRestClient
--snip-- # omitted
➋ >>> twilioCli = TwilioRestClient(accountSID, authToken)should be:
➊ >>> from twilio.rest import Client # changed
--snip-- # omitted
➋ >>> twilioCli = Client(accountSID, authToken) # changedbecause TwilioRestClient has been depreciated (using twilio 6.16.4).
On reference number 685.5, paragraph 25.195, the line ➊ >>> updatedMessage = twilioCli.messages.get(message.sid) should be ➊ >>> updatedMessage = twilioCli.messages(message.sid).fetch() because the attributes of messages.get() were changed.
In Chapter 16, reference number 687.8, paragraph 25.201 (textMyself.py), the codeblock:
--snip-- # omitted
from twilio.rest import TwilioRestClient
➊ def textmyself(message):
➋ twilioCli = TwilioRestClient(accountSID, authToken)
--snip-- # omittedshould be:
--snip-- # omitted
from twilio.rest import Client # changed
➊ def textmyself(message):
➋ twilioCli = Client(accountSID, authToken) # changed
--snip-- # omittedIn paragraph 25.202, the line:
It then defined textmyself() to take on argument ➊, make a TwilioRestClient object ➋, and call create() with the message you passed ➌.
In Chapter 17, reference number 724.1, paragraph 26.122, the line ➌ im = im.resize((width, height)) is over indented.
On reference number 734.5, paragraph 26.163, the codeblock:
--snip-- # omitted
>>> fontsFolder = 'FONT_FOLDER' # e.g. 'Library/Fonts'
➍ >>> arialFont = ImageFont.truetype(os.path.join(fontsFolder, 'arial.ttf'), 32)
➎ >>> draw.text((100, 150), 'Howdy', fill='gray', font=arialFont)
--snip-- # omittedwill need to be changed for those on Ubuntu, specifically:
--snip-- # omitted
>>> fontsFolder = '/usr/share/fonts/truetype' # e.g. 'Library/Fonts' # modified
➍ >>> liberationFont = ImageFont.truetype(os.path.join(fontsFolder, '/liberation/LiberationSerif-Regular.ttf'), 32) # modified
➎ >>> draw.text((100, 150), 'Howdy', fill='gray', font=liberationFont) # modified
--snip-- # omittedHowever, everyone will have to modify it for their system.
In Chapter 17, reference number 738.6, paragraph 26.194, the line:
Other wise, it should skip adding the logo.
In Chapter 17, reference number 739.4, paragraph 26.198, the codeblock:
#! python3 #
Import modules and write comments to describe this program.
--snip-- # omittedmay need to be:
#! python3
# Import modules and write comments to describe this program.
--snip-- # omittedOn reference number 740.0, paragraph 26.200, the line:
For each of the guests listed in the guests.txt file from the resources at http://nostarch.com/automatestuff/, generate an image file with the guest name and some flowery decoration.
may need to be:
For each of the guests listed in the guests.txt file from the resources at http://nostarch.com/automatestuff/, generate an image file with the guest's name and some flowery decoration.
I couldn't find the public domain flower image mentioned in the book, so I used this one.
I have a working seating card program (contains spoilers): https://pastebin.com/qP7jTw34 uploaded to pastebin to save space.
Of note is resizing images to be larger with the pillow module. I had to use image = image.resize((width, height), Image.ANTIALIAS) on the .png decoration file; otherwise, it wouldn't change the size at all.
For Chapter 18, if running Ubuntu 18.04.1 in a VirtualBox virtual machine, mouse integration needs to be turned off so that the pyautogui module can control the mouse. Remember that the Host Key will need to be pressed to manually toggle keyboard/mouse capture.
In Chapter 18, reference number 764.0, paragraph 27.77, the codeblock:
#! python3
# mouseNow.py - Displays the mouse cursor's current position.
--snip--
positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
pixelColor = pyautogui.screenshot().getpixel((x, y))
positionStr += ' RGB: (' + str(pixelColor[0]).rjust(3)
positionStr += ', ' + str(pixelColor[1]).rjust(3)
positionStr += ', ' + str(pixelColor[2]).rjust(3) + ')'
print(positionStr, end='')
--snip--may need to be:
#! python3
# mouseNow.py - Displays the mouse cursor's current position.
import pyautogui, os # changed
--snip--
positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
pixelColor = pyautogui.screenshot().getpixel((x, y))
positionStr += ' RGB: (' + str(pixelColor[0]).rjust(3)
positionStr += ', ' + str(pixelColor[1]).rjust(3)
positionStr += ', ' + str(pixelColor[2]).rjust(3) + ')'
print(positionStr, end='')
print('\b' * len(positionStr), end='', flush=True)
except KeyboardInterrupt:
files = os.listdir('./') # added
for file in files: # added
if file.startswith('.screenshot'): # added
os.remove(os.path.join('./', file)) # added
print('\nDone.')to cleanup all the .screenshot### files left behind in Ubuntu 18.04. This could be because the exception handler doesn't give PyAutoGUI a chance to do it.
In Chapter 18, reference number 765.5, paragraph 27.81, the line:
... replacing 'submit. png' with the filename of your screenshot:
In Chapter 18, reference number 781.5, paragraph 27.192, the line:
... then mouse over the Name field to figure out its the x- and y-coordinates.
To set up the coordinates for formFiller.py, you need to open a terminal window (or command prompt), run the mouseNow.py script, resize it to something small, keep it in the foreground, and hover over the maximized browser in the background as you note the mouseNow.py data.
As you enter data in the form, you may need to keep bringing back the mouseNow.py window into the foreground. For some reason, that wasn't explained clearly enough for me.
Tip: If "This is a required question" appears below the Name field, it will affect the coordinates of the Submit button.
On reference number 791.8, paragraph 27.213, the lines:
... whether it has gotten offtrack. You can even give PyAutoGUI a screen-shot and ...
On reference number 793.8, paragraph 27.236, the line:
Your program will have to take screen-shots to guide...
r/inventwithpython • u/AlSweigart • Oct 01 '21
Whoa.
I'd like to thank everyone on Reddit and all the folks who have taken my course or read my programming books. I'm completely floored by the response I've gotten to this course. It's incredible and I feel so fortunate for being able to have such a large impact. As I write this, there are 999,866 folks who have signed up for my beginner programming course, so it looks like today, October 1st, 2021, will the day when I reach 1,000,000 sign ups. The vast majority of these are free sign ups. According to my metrics, only about 8% or so of students finish the course (about average for online courses).
But knowing that I've been able to teach roughly tens of thousands of folks to program really... gives me a satisfied sense that I'm useful. As Muhammad Ali put it, "Service to others is the rent you pay for the room here on earth." It's something I worry about a lot, but the number of people telling me they find my stuff useful is a great reassurance.
Thank you.
Anywhere, here's the usual info:
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: OCT2021FREE
https://www.udemy.com/course/automate/?couponCode=OCT2021FREE
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.
This promo code works for 3 days (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 OCT2021FREE2 in 3 days, and that code will work for another 3 days.
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.
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.
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 • u/AlSweigart • Sep 25 '25
Use code SEP2025CODE to sign up for the course for free. There are 1,000 sign ups available for the next four days. I'll post new codes as the old ones get used up. You can always use this link for the latest code:
r/inventwithpython • u/AlSweigart • Aug 09 '22
NOTE: The codes are all used up. But you can watch the first 15 of the 50 videos for free on YouTube. If you want to buy the rest of the course, the https://inventwithpython.com/automateudemy link redirects to a discount code that lowers the price to $13. The course follows the info in the book, which is for free in full at https://automatetheboringstuff.com/
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):
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 • u/AlSweigart • Oct 02 '22
UPDATE: The sign ups have run out. You can still find the first 15 videos of the 50 video course on YouTube for free. Also, check out my new book with programming exercises for beginners for free or as a 99 cent ebook.
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):
https:// udemy. com/course/automate/?couponCode=OCT2022FREE
https:// udemy. com/course/automate/?couponCode=OCT2022FREE2
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