Taking Python out for a spin on MacOS X with TextWrangler
-
Open up TextWrangler and you will see the window below:
-
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.
-
Now bring up the folder where you saved hello.py in a file explorer window. Select the OpenIPythonHere icon on the navigation bar.
-
Now you can get Python to interpret your program. A terminal window opens up, as shown below, with the Python interpreter running.
-
To run your command stored in hello.py, all you have to do is type in
run hello
at the Python command prompt. -
Python prints
Hello world!
as requested. That's all you need to do to open/create, edit, and run your files!