Python modules

IDLE is the standard python IDE included with every python installation.

Python uses sys.path to look for modules, it includes the contents of PYTHONPATH. We can check the current contents of sys.path from IDLE through File > Path Brower, or by the following command:

import sys

To load modules from different locations into IDE we can issue the following command:


Note the escaped backslashes, otherwise we will receive ‘Unicode Error‘.

After this we can import ay module from the added location.

If we are on Unix\Linux we can use the following technique to append entries to PYTHONPATH on command line:

PYTHONPATH=/foo/bar/baz python somecommand


Tagged with:
Posted in Python

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: