Skip to content

Instantly share code, notes, and snippets.

@deostroll
Created July 29, 2012 07:52
Show Gist options
  • Save deostroll/3196562 to your computer and use it in GitHub Desktop.
Save deostroll/3196562 to your computer and use it in GitHub Desktop.
example of how import works
$ cd ~/scripts/tmp
$ touch m1.py
$ pico m1.py
$ cat m1.py
print 'Imported module m1'
def m1foo():
print 'executed m1 foo'
$ python
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import m1
Imported module m1
>>> m1.m1foo()
executed m1 foo
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment