python_import_learning

# author: Roy.G

import os,sys
import time

'''
from module_test import mod_1 as test_1 #change module name

test_1() # use the changed name to call it
# from module_test import name,num #import a variable from a file
path=os.path.abspath(__file__)
path_1=os.path.dirname(path)
path_2=path_1+"\\module_test"
print(path)
# print(name)
# print(num)
import package_test
print(path_2)
sys.path.insert(0,path_2) #intert the path to index 0
import package_test #import package means running the __init__ file
# package_test()
import test_3
test_3.t1()
print(sys.path)


from . import test_5
'''
x=time.time()
y=time.localtime()
print(x,y)

posted on 2022-01-08 18:46  ttm6489  阅读(18)  评论(0编辑  收藏  举报

导航