COMP 200 Elements of Computer Science &
COMP 130 Elements of Algorithms and Computation
Spring 2012

Taking Python out for a spin on MacOS X with TextWrangler

  1. Open up TextWrangler and you will see the window below:

    TextWrangler
  2. Type in one simple command: print "Hello, world!".

    Select the Save As option from the File menu on the top toolbar, and save this file as hello.py in your course folder. You will see the name change reflected in the Textwrangler window and you will find your code syntax highlighted as shown.

    hello.py
  3. Now bring up the folder where you saved hello.py in a file explorer window. Select the OpenIPythonHere icon on the navigation bar.

    OpenIPythonHere
  4. Now you can get Python to interpret your program. A terminal window opens up, as shown below, with the Python interpreter running.

    terminal
  5. To run your command stored in hello.py, all you have to do is type in run hello at the Python command prompt.

    run
  6. Python prints Hello world! as requested. That's all you need to do to open/create, edit, and run your files!