r/inventwithpython • • Nov 05 '23

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

10 Upvotes

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=NOV2023FREE

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

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.

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. If you have a VPN service, try to sign up from a North American or European proxy. Please post in the comments if you're having trouble signing up and what country you're in.

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 • • Jun 04 '17

Hello world! [Invent]

6 Upvotes

Hello world!

Just wanted to drop by the /r/ I found in "invent your own computer games with Python" and say hi to all the people trying to learn python and coding.

Keep on keepin on your all awesome!


r/inventwithpython • • Jun 06 '17

More practices to cement things? [Automate]

2 Upvotes

Hi All,

I've been working through Automate the Boring Stuff after picking up a humble bundle for it ages ago. I love the writing style and the way things are explained, but I feel starved for practice opportunities to really drill loops into my head - I'm on Chapter 5 and for the last couple of chapters, I feel like I understand the concepts easily enough, I can answer the questions quickly and correctly, but then I stutter when I come to write it.

So I guess this post is both a comment for Al (I see you're kind enough to read this sub frequently), as well as a request for a recommendation for somewhere that just drills you on the stuff I've learnt in the last five chapters, so I can get them further ingrained in my head. Otherwise I worry that I'm building shaky foundations.

Thanks all!


r/inventwithpython • • Jul 08 '16

Unable to find/access the exercises for chapter 13 and beyond in "Hacking Secret Ciphers with Python"

3 Upvotes

I am unable to access any of these exercises, and feel that I should stop at this point, the exercises have been really helpful cementing things as I progress through this excellent text.

Any help would be greatly appreciated. Thank you.


r/inventwithpython • • Dec 23 '15

Why doesn't this work? Chapter 6 Practice Project (Table Printer) TypeError

2 Upvotes

Here's my code:

tableData = [['apples', 'oranges', 'cherries', 'banana'],
             ['Alice', 'Bob', 'Carol', 'David'],
             ['dogs', 'cats', 'moose', 'goose']]

def printTable(L):
    colWidths = [0] * len(L)
    colWidths[0] = max(L[0], key=len)
    colWidths[1] = max(L[1], key=len)
    colWidths[2] = max(L[2], key=len)
    for y in range(len(L[0])):
        for x in range(len(L)):
            word = L[x][y]
            print word.rjust(len(colWidths[x]), end= ' ')
        print

printTable(tableData)

It says this when I run it ----> "TypeError: rjust() takes no keyword arguments"


r/inventwithpython • • Jun 27 '16

Chapter 7 - Debugger runs PyShell.py while stepping

1 Upvotes

Basically, I can't finish Chapter 7, because I can't step through input() function. Debugger just starts PyShell.py and if I don't use step out, I have to restart the program in order for it to work.

Edit: For people who have the same problem - it worked for me when I was clicking "out" instead of "step", because if you step through built-in functions the file PyShell.com will be opened. (Description in the book is a little bit confusing)


r/inventwithpython • • Jun 27 '16

Chapter 9 - Hangman - How are these functions called?

2 Upvotes

I'm trying to go through every line in this example and figure out what is happening exactly. So far i have been succesful but their are two things I can't figure out.

On line 116 he states guess is equal to the getGuess function but for some reason this calls the function as when running the program it asks the player to enter a letter. How does setting this function to a variable run it. Very confused

112. while True: 113. displayBoard(HANGMANPICS, missedLetters, correctLetters, secretWord) 114. 115. # Let the player type in a letter. 116. guess = getGuess(missedLetters + correctLetters) 117. 118. if guess in secretWord: 119. correctLetters = correctLetters + guess

The same thing goes for on line 141 when he states an if function containing the playAgain variable. This also calls the function.

139. # Ask the player if they want to play again (but only if the game is done). 140. if gameIsDone: 141. if playAgain(): 142. missedLetters = '' 143. correctLetters = '' 144. gameIsDone = False 145. secretWord = getRandomWord(words) 146. else: 147. break

How does this work. I thought you actually had to type the function like on line 113 to run it.


r/inventwithpython • • May 06 '15

Automate the Boring Stuff Practice Project (Table Printer)

5 Upvotes

Hey Guys, can you help me check my code? It's for the Table Printer Practice Project at the end of Chapter 6

tableData = [['apples', 'oranges', 'cherries', 'banana'],
['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']]



def printTable(tableData):
    colWidths = [0] * len(tableData)
    for i in tableData:
        for j in i:
            for k in range(len(tableData)):
                if len(j) > colWidths[k]:
                    colWidths[k] = len(j)
    colWidths.sort()               
    print(colWidths[-1])           

    for a in range(len(tableData)-2):
        for b in range(len(tableData[0])):
                             
            print(tableData[a][b].rjust(colWidths[-1])+tableData[a+1][b].rjust(colWidths[-1])+tableData[a+2][b].rjust(colWidths[-1]))




printTable(tableData)

the code produces the right ouput, but I had to put a -2 in the for a in range(len(tableData)-2): line and I have no idea why that works.

Thanks and let me know if there's a more elegant solution.


r/inventwithpython • • Jul 27 '13

Where can I download Pygame for Python 3.3? (Link to download page.)

Thumbnail bitbucket.org
2 Upvotes

r/inventwithpython • • Mar 16 '18

Missing module

2 Upvotes

I tried to run this program that I download from your site.

Simple Substitution Dictionary Hacker, https://inventwithpython.com/hacking (BSD Licensed)

import pyperclip, simpleSubKeyword, detectEnglish

It fails with the message:

RESTART: D:\Users\patjd\My Software Projects\Python\Tutorial\simpleSubDictionaryHacker.py Traceback (most recent call last): File "D:\Users\patjd\My Software Projects\Python\Tutorial\simpleSubDictionaryHacker.py", line 2, in <module> import pyperclip, simpleSubKeyword, detectEnglish ModuleNotFoundError: No module named 'simpleSubKeyword'

I bought the Kindle edition of your book from Amazon.


r/inventwithpython • • Dec 26 '16

How to import a homemade Python module.

2 Upvotes

I am trying to import a custom Python function. The book I am reading says you can just do import function

This doesn't seem to work for my interpreter, The book is from 2016, but Python can change quickly. What's the new way to do this?


r/inventwithpython • • Dec 20 '15

chapter 9: Hangman

2 Upvotes

I have typed the program but it doesn't run.showing ''inconsistent use of tabs and spaces in indentation" on line 73. I have enter the the program exactly as it is given in the book.

70. print('Missed letters:', end=' ') 71. for letter in missedLetters: 72. print(letter, end=' ') 73. print()


r/inventwithpython • • Dec 21 '15

Ch3: Memory Game - How do I use my own images?

1 Upvotes

I am new to python and coding in general... so I'm havinga bit of trouble.

I understand the code in this chapter but I want to change it to incorporate my own .pngs rather than simple shapes. This seems to not like interacting with colours...

Effectively I want the colours to not just be rgb values but code that alters the pngs to be a different hue? How would I go about doing this? is it possible?

Sorry for rambling, hope this makes even a bit of sense... Any help is much appreciated.


r/inventwithpython • • Dec 31 '16

Memoization a function to make it run faster?

4 Upvotes

I am trying to Memo this function http://pastebin.com/n0KkE2Yr I have no syntax errors, but the output is very strange. I think it has to do with all the recursion going on, but I am not sure. Can someone explain to me what's wrong?


r/inventwithpython • • Jan 13 '22

Are these two python code snippets equivalent (perform the same thing)?

7 Upvotes
import pyautogui as auto

Snippet 1 :-

meetStartCheck = auto.locateOnScreen('img.png')
meetStartCheck1 = auto.locateOnScreen('my_screenshot.png')

Snippet 2 :-

meetStartCheck, meetStartCheck1 = auto.locateOnScreen('img.png', 'my_screenshot.png')

The code next to these lines is :-

if meetStartCheck or meetStartCheck1:
    print("Done")
else:
    print("Not Done")

Please tell if these both codes are equivalent or not. If not plz help me to write a single python line for the Snippet 1(if possible).

Thanks


r/inventwithpython • • Feb 01 '21

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

53 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: 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 • • Jan 06 '21

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

43 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: 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 • • Jan 18 '21

Please help me understand the Hangman Code

5 Upvotes

I had a doubt in the hangman code. Please help.

In displayboard function

print('Missed letters:', end=' ')

for letter in missedLetters:

print(letter, end=' ')

print()

Will the last print() be executed after the for loop or during the loop. And please tell the reason for that also.The second last print function is indented. Please refer to book.


r/inventwithpython • • Mar 17 '21

Al Sweigart's next book "The Big Book of Small Python Projects" is available for preorder at 30% off with code MIGHTYSMALL

Thumbnail
nostarch.com
59 Upvotes

r/inventwithpython • • Mar 03 '21

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

53 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: 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 • • Jul 19 '23

python ETL based project

1 Upvotes

currently i practice on one dumpy ETL based project.

in this project i used tools such as python, sql server, power BI application.

my doubts are, can i create staging area database and data warehouse database are else company create if incase company create how to find it both of them.

and after transfer the data into DW what will do next please share any one our experience like real sceneries. it will help full for my career and skills.


r/inventwithpython • • Jul 14 '23

My doubt

6 Upvotes

Hi sir i'm a 8th grade student from india .I just brought your 'automate the boring stuff with python' and I have doubt from it that: Print('what is your age?')#ask for their age myAge=input() Print('you will be '+str(int(myAge)+1)+'in a year.') Page no.17 Here I converted myAge into int() then what's the use of str() here?


r/inventwithpython • • Jul 19 '15

IDLE does not load at all

1 Upvotes

I'm completely new to python and will use Sweigart's awesome book. I can't really start yet because I can't get the IDLE program to load. I try loading IDLE in two ways:

  1. going through the windows start menu (screenshot below)

  2. double clicking pythonw.exe (second screenshot below) When I try either of these, absolutely nothing happens. I right clicked/properties the IDLE icon from the first image and it says the target is: C:\Python\pythonw.exe "C:\Python\Lib\idlelib\idle.pyw"

I'm running windows 7, 64-bit. I downloaded/installed "python-3.5.0b3-amd64". The interactive shell works fine when I double click python.exe (a MS-DOS looking window pops up with the >>> prompt). I tried uninstall/re-install. I tried running the 32-bit. I hit CTRL-ALT-DEL and checked if the pythonw.exe process is running in the background. I googled for solutions, but can't find anything.

http://imgur.com/XPhd5WG http://imgur.com/JqIlArC

Thanks!!!!!!!!!!!!!!


r/inventwithpython • • Sep 06 '16

[ERROR] IDLE can't import Tkinter.

1 Upvotes

So i've just got the book and i was so excited to start coding, installed python and when i tried to run it, i got "Idle can't import Tkinter, Your Python may not be configured for Tk" I tried google but no use. I am using 64bit of Ubuntu 16. Could anyone help me out please?


r/inventwithpython • • Jul 23 '17

Automate the boring stuff Table Printer

2 Upvotes

Hey this was the first thing in the book that was actaully quite challenging, this is my code. Probs really hard to read, but it works quite well no matter how long the text is. Also do we have to make it handle more than 3 lists and more than 3 list items, or do we just have to make it work with the example.

CODE

data

tableData = [['Alicegaetgeag','Bffffffffffob','Carffffffffffffffffffffffffffffol', 'David'],['affffffffffffffffpples', 'orangfeaaaaaaaaaaaaaes', 'cherries', 'bannanas'],['Dogs', 'Catf eaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaas', 'Moose', 'Goose']]

setting col list which keeps track of colLength of eachlist

col = [0] *len(tableData) a = 0 length = 0 length1 = 0 length2 = 0

you want to iterate over each list item measuring the length of each if the, making sure to switch to new variable when you finish a list

for i in range(((len(tableData))*len(tableData[0]))): if i < 4: a = 0 if len(tableData[a][i]) > length: length = len(tableData[a][i]) col[0] = len(tableData[a][i])

if i > 3 and i < 8:
    a = 1
    i -= 4
    if len(tableData[a][i]) > length1:
        length1 = len(tableData[a][i])
        col[1] = len(tableData[a][i])
elif i > 7 :
    a = 2
    i -= 8
    if len(tableData[a][i]) > length2:
        length2 = len(tableData[a][i])
        col[2] = len(tableData[a][i])

if i+1%(len(tableData)+1) == 0:
    a += 1
    if a == 3:
        break

print(col) for i in range(len(tableData[0])): print(tableData[0][i].ljust(col[0]) + tableData[1][i].rjust(col[1]+1) + tableData[2][i].rjust((col[2])+1))