MCSR_logo.jpg (56K)
Home My MCSR Supercomputers Software Research Education
Login
Issues/Circulation
Current Issue: Feb. 2007

Past Issues

Research
- Furmanchek Tops MCSR's Top 5 List

MCSR Events
- MSUAG Meeting at MAS & Math/CS/Stats Division Presentation Schedule

Software
- Materials Studio
- g03sub Update

- Java at MCSR

- Python on Willow

Education
- MCSR Campus Visits

- New HPC Blog
- MCSR in the Classroom

MCSRLogo2 (17K)

Python on Willow

General Information

Version: 2.5
Executable: /usr/local/bin/python

Description

Python is an object-oriented, high-level programming language.

Python can be run in either interactive or interpreted mode. In interactive mode, the user types code directly into the python interface, and the python interpreter immediately executes the user's code at the end of each line or block entered. In interpreted mode, the user first creates a program in a text editor, and then feeds the entire program into the python interpreter, at which time it is executed as a whole.

Users of Willow should already have the python executable in their PATH.
To invoke the interactive mode, type:
       python

To interpret a previously written program, type:
       python my_program.py

Simple Example

This is a complete python program that will first add 2 + 2, print the result, and then print the numbers 0 to 9 on a single line:

#pythontest.py


# add 2 + 2
print "2 + 2 = ", 2 + 2

# print just an empty line
print


# display numbers 0 to 9
for number in range(10):
    print number,


More Information about Python

  • Python Tutorial - Written by the creator of Python
  • Python (programming language) - Wikipedia article on Python

  • Last Modified:June 08, 2007 10:31:45.   Copyright © 1997-2012 The Mississippi Center for Supercomputing Research. All Rights Reserved.   The University of Mississippi
    Valid RSS