Boston Python workshop 2/Friday setup/Python scripts on Windows: Difference between revisions

imported>Jesstess
(Created page with 'We are going to practice writing and running Python scripts. ===Start your text editor=== # Launch the Notepad++ text editor. See the [[Boston_Python_workshop_2/Friday_setup/Wi…')
 
 
(3 intermediate revisions by 2 users not shown)
Line 14:
</pre>
 
# Save the script as <code>hello.py</code> in your homeDesktop directory. The <code>.py</code> extension indicates that this file contains Python code.
 
===Run the script===
 
# Start a new command prompt. See the [[Boston_Python_workshop_2/Friday_setup/Terminal_navigation_on_Windows|terminal navigation on Windows]] instructions for the steps to do this.
# Navigate to your homeDesktop directory from a command prompt, using the <code>dir</code> and <code>cd</code> commands. See the [[Boston_Python_workshop_2/Friday_setup/Terminal_navigation_on_Windows|terminal navigation on Windows]] instructions for a refresher on using these commands. Don't hesitate to get help from a staff member on this step if you need it -- it's a new way of navigating your computer, so it may be unintuitive at first!
# Once you are in your homeDesktop directory, you'll see <code>hello.py</code> in the output of <code>dir</code>.
# Type
 
Line 41:
* When you run the <code>python</code> command by itself, you start a Python prompt. You can execute Python code interactively at that prompt.
* When you run the <code>python</code> command with a file name as an argument, Python executes the Python code in that file.
 
[[Boston Python workshop 2/Friday setup|&laquo; Back to the Friday setup page]]
Anonymous user