How do I get to the shell?
We'll use a program called IDLE. It comes with Python.
To run IDLE, open the command line and type IDLE.
For Windows, hit the Windows key, type "cmd", and hit enter.
For Mac, open the Terminal application in your Applications Folder.
What do I do with the shell?
The shell interacts directly with Python.
You type one instruction, Python executes that one instruction.
Things go back and forth, one at a time. You, Python. You, Python.
Try typing a math expression.
You should see Python execute the math expression and print out the result.
Now try out the "print" statement.
Python will echo back whatever you asked it to print.
What if we remove the word "print" from our instruction?
Python will echo back whatever you typed.
But notice the difference between this response and our previous instruction with the word "print".
Now make your first variable.
We've assigned x to hold the value of "Wendy".
And let's print out x.
What do I do with the file?
Cut and paste this code sample in the file and save it.
I used the name "firstFile.py".
Make sure to get the ".py" extension.
Save the file. At home you could save to the desktop while testing.
Now, in the IDLE menu, click "Run" -> "Run Module".
So now you've run some Python code in the shell and in a file. The key differences: