Difference between revisions of "Python/Interactive"

From ScientificComputing
Jump to: navigation, search
(Created page with "In order to start an interactive Python session on one of the login nodes, you can use the command <tt>python</tt> to start the Python interpreter. Interactive sessions can be...")
(No difference)

Revision as of 11:12, 23 August 2016

In order to start an interactive Python session on one of the login nodes, you can use the command python to start the Python interpreter. Interactive sessions can be used to check if a particular package is already installed or not (if a package is not installed, the import statement will result in an error).

[leonhard@euler06 ~]$ module load gcc/4.8.2 python/2.7.6
Autoloading openblas/0.2.13_seq
[leonhard@euler06 ~]$ python
Python 2.7.6 (default, Jan 20 2014, 14:02:29) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import a_module_that_does_not_exist
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named a_module_that_does_not_exist
>>>