Announcements | Course Info | Schedule/Slides | Assignments | FAQ | Section | Demos | Newsgroup |
Frequently asked questions about the course and assignments.
However, you may prefer to work from home. The simplest option is to remotely login to an
instructional machine using an SSH client (for Windows: SSH Secure Shell or PuTTY). Some login servers you can
use are {cory.eecs, quasar.eecs, star.cs, solar.cs}.berkeley.edu
. The main
problem with remote login is that editing code and debugging can be a pain within a terminal
window. To display graphics and windows, you could install an X windowing system (for
Windows: Hummingbird Exceed
or XFree86). However, depending on your Internet
connection, the graphics could transmit slowly -- resulting in an excruciating keystroke
lag.
To develop your code at home, you must install Python on your system. You can download
this freely at www.python.org. These versions often come
packaged with IDLE, a minimalist Integrated Development Environment that should be sufficient
for editing and testing Python code. Alternatively, you could use the more complex but
helpful IDE Eclipse IDE (Eclipse
tutorial). Or, you could use Cygwin to emulate a
Linux terminal on Windows. There are Cygwin packages available for many *nix tools, such as
Python and Emacs. Regardless of how you choose to work at home, however, you will always have
to eventually transfer your files to your instructional account, where you will probably want
to test them again prior to submitting.
filename.py
. How do I execute it from the Python
interpreter?filename.py
is in (or if it's
in the Python path...), then you can import the contents of filename.py
as a module:
>>> import filename
>>> filename.function(arguments)
With this kind of import statement, you must reference the module name followed by the
function name. Alternatively, you can import the contents of filename.py
into
the local namespace:
>>> from filename import *
>>> function(arguments)
With this kind of import statement, you no longer need to reference the module name.