Created
July 29, 2012 07:52
-
-
Save deostroll/3196562 to your computer and use it in GitHub Desktop.
example of how import works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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