Interactive Python

ipython

Log in to Luria.

# Land on a compute node
srun --pty bash

# Make a directory for the course
mkdir test_python

# Go to the directory for the course
cd test_python

# Invoke Python
module load python

# Start Python interpreter
ipython

Using Python as a calculater

In [1]: 1+2

Out[1]: 3

In [2]: 1+2*3+4*5

Out[2]: 27

Print "Hello World!"

In [1]: print("Hello World!")
Hello World!

Last updated

Massachusetts Institute of Technology