Boston Python Workshop 5/Friday/Windows Python scripts: Difference between revisions

From OpenHatch wiki
Content added Content deleted
Line 1: Line 1:
We are going to practice writing and running Python scripts.
We are going to practice writing and running Python scripts.


You're a real deep thinker. Thanks for sharnig.
===Start your text editor===

# Launch the Notepad++ text editor. See the [[Boston Python Workshop 5/Friday/Windows_text_editor|Windows text editor setup]] instructions for the steps to do this.
# Start a new, blank text file.


===Write and save a short Python script===
===Write and save a short Python script===

Revision as of 07:24, 5 May 2012

We are going to practice writing and running Python scripts.

You're a real deep thinker. Thanks for sharnig.

Write and save a short Python script

  1. Add the following line to your new text file:
print "Hello World!"
  1. Save the script as hello.py in your Desktop directory. The .py extension indicates that this file contains Python code.

Knowledge wants to be free, just like these artilces!

Success

You created and ran your first Python script!

  • When you run the python command by itself, you start a Python prompt. You can execute Python code interactively at that prompt.
  • When you run the python command with a file name as an argument, Python executes the Python code in that file.

« Back to the Friday setup page