文件结构
入口文件·
将当前文件的父级,加入搜索目录里面
import sys
import os
current_dir = os.path.abspath(os.path.dirname(__file__))
print(current_dir) #F:\project\pritice
sys.path.append(current_dir+'/..')
# sys.path.append(r'F:\python历程\python基础\模块理解\one')
import package_runoob.runoob1 as runoob1
import package_runoob.runoob2 as runoob2
runoob1.runoob1()
runoob2.runoob2()
原文地址:https://www.cnblogs.com/panfengde/p/11231493.html
时间: 2024-10-15 18:28:32