python中执行其他的python脚本(二):

test1.py代码:

1 def disp():
2     print 'hello world!'

同目录下test2.py代码:

1 import test1
2 
3 print 'Hello jju!'
4 test1.disp()

执行结果没问题

原文地址:https://www.cnblogs.com/guochaoxxl/p/13831859.html