Ale*_*lex 1 python working-directory
如何从Python脚本中找出当前的运行时目录?
Mar*_*ler 6
使用os.getcwd.这将告诉您当前的工作目录.如果您使用创建新文件
os.getcwd
fp = open('a.txt', 'w')
然后a.txt将在当前工作目录中创建.使用os.chdir改变工作目录,如果需要的话.
a.txt
os.chdir
归档时间:
16 年,9 月 前
查看次数:
1039 次
最近记录:
13 年 前