Getting Started:
Here's the pattern we expect you to take when starting one of our
Python computer exercises.
We assume you are running on a system
which was set up for doing scientific Python, as described in
The World is your Python. You can check this by running our
Python demos at
http://www.physics.cornell.edu/sethna/StatMech/ComputerExercises/UnpackAndRunPythonDemos.py, which will download and run a large
number of different solutions to exercises: download and run the Python file,
or (if you are trusting) just open it directly from your Web browser
using /usr/bin/python (or whatever the appropriate path is, say, determined
by the command "which python").
For clarity, we
assume you are starting up the Small Network exercise: change the
names of the directories as appropriate for the
exercise you are working on.
- Make a directory called "SmallWorld" (using folders, or the command
"mkdir SmallWorld")
- Start up a Web browser (Applications -> Internet -> ...)
find the computer exercises page
http://www.physics.cornell.edu/~sethna/StatMech/ComputerExercises.html,
and find the Web page for the Small World network.
- Download each of the Python software files and hints files into
your directory SmallWorld, except for the "Answers and Demos" file.
- Start a terminal (Applications -> System Tools -> Terminal, or
click on the screen logo on the toolbar), and type
- cd SmallWorld
[changes directory]
- ls
[should show the files you downloaded]
- pydoc SmallWorldNetworkHints
[gives documentation for
SmallWorldNetworkHints.py]
- cp SmallWorldNetworkHints.py SmallWorldNetwork.py
[copies file]
- xemacs SmallWorldNetwork.py
[edit file, save file]
- python -i SmallWorldNetwork.py
[run python, ^D to exit python, edit Python, repeat]
- For help on using Python, see the Python
Nanotutorials at http://www.physics.cornell.edu/~myers/teaching/ComputationalMethods/python/NanoPy/NanoPy.html or the textbook Learning Python by Lutz and Ascher.
Last modified: January 20, 2005
Statistical Mechanics: Entropy, Order Parameters, and Complexity,
now available at
Oxford University Press
(USA,
Europe).