【发布时间】:2022-08-19 07:24:19
【问题描述】:
我有一个从其他地方导入模块的 client.py。所以我想使用命令“python client.py”更改工作目录。
-
os.chdir()tutorialspoint.com/python/os_chdir.htm
标签: python
我有一个从其他地方导入模块的 client.py。所以我想使用命令“python client.py”更改工作目录。
os.chdir()tutorialspoint.com/python/os_chdir.htm
标签: python
我想这就是你要找的
import sys
sys.path.append('/path/to/application/app/folder')
#use '../' to jump back one folder
import file
代码来自here
【讨论】: