Python定制化库的导入
/opt/tmp/a.py
def hello():
print "hello from a"
/opt/tmp/b.py
import sys
sys.path.append("/opt/tmp/a.py")
from a import hello
hello()
output:
hello from a
/opt/tmp/a.py
def hello():
print "hello from a"
/opt/tmp/b.py
import sys
sys.path.append("/opt/tmp/a.py")
from a import hello
hello()
output:
hello from a