如何在Python3中使用我自己的文件作为默认模块?

时间:2016-07-29 13:49:57

标签: python-3.4

import myfile
function1(2,3,4)

如何将我的文件用作默认模块,这样我只需输入import myfilename即可使用它而无需指定

import sys   
sys.path.insert(0 ,'/dir1/dir2')    
import myfile    
myfile.function1()

0 个答案:

没有答案