Look — a new Python 3 resource for you.
In the middle of chapter 1 in Automate the Boring Stuff with Python, Sweigart invites you to leave the interactive Python shell (where you have the >>> prompt) and create a little program in a file.
Do not use IDLE. We are never using IDLE.
Instead, you can use Atom, our trusted code editor. Code is code. You can write any code in Atom. Instead of saving the file with a .html or .js extension, we save it with a .py extension when it is a Python file.
Then, how do you run it? Never try to run a file at the >>> prompt. You need to be at the bash prompt ($) in Terminal, or the PowerShell prompt if you’re using Windows.
It’s easiest if you are in the same directory where the .py file was saved. Use your cd command (Command Line Tips) to get there. (I made a folder named automate for my files from the book.)
At the bash prompt, type this (using your actual filename, of course)
And it runs!
Here’s where that comes in the chapter:
Here’s what the program looks like in Atom:
Here’s how I ran it in Terminal: