Importing
eharetea

Using the import function to import modules.

Importing.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Friday August 01st, 2008 01:31 AM

# File named testing.py:
import dircache
L = dircache.listdir('.')



# import testing:

>>> import testing
>>> testing.L
['.CFUserTextEncoding', '.DS_Store', '.Trash', '.bash_history', '.ssh', '.viminfo', 'Applications', 'Desktop', 'Documents', 'Library', 'Movies', 'Music', 'Pictures', 'Public', 'Sites', 'testing.py', 'testing.pyc']


>>> from testing import L
>>> L
['.CFUserTextEncoding', '.DS_Store', '.Trash', '.bash_history', '.ssh', '.viminfo', 'Applications', 'Desktop', 'Documents', 'Library', 'Movies', 'Music', 'Pictures', 'Public', 'Sites', 'testing.py', 'testing.pyc']