Example #1
0
import mymodule
import imp

mymodule.show()
print(mymodule.name)


#print(dir(mymodule))  # dir   查看模块函数
def show():
    print('*' * 20)


#print(mymodule.show())
mymodule.show()
imp.reload(mymodule)
print(show())
# #from mymodule import show  #指定函数
# from mymodule import *  #  * 导入多个
# show()
# dir(mymodule)
Example #2
0
import mymodule as m
m.hello()
m.show()
m.sum(2, 3)
Example #3
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import mymodule
mymodule.show()
mymodule.name="usemodule.py"
print mymodule.name

Example #4
0
# using a module
import mymodule

mymodule.show("Ashish")
Example #5
0
import mymodule as mm

print('#' * 40)
mm.show()

#print(mm.name)

#dir(mm)