Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "test"
- def print_a():
- print "aa"
- if __name__ == "__main__":
- imp = __import__("one")
- print dir(imp)
- import one
- import two
- import three
- if __name__ == '__main__':
- one.foo()
- two.bar()
- three.baz()
- import one
- import two
- import three
- result = one.func()
- instance = two.YourClass()
- something = three.func()
- #file: thisfile.py
- def func():
- return 1,2,3
- if __name__ == "__main__":
- if func() != (1,2,3):
- print "Error with func"
- else:
- print "func checks out OK"
- #anotherfile.py
- import thisfile
Add Comment
Please, Sign In to add comment