【发布时间】:2013-06-25 22:21:08
【问题描述】:
当我在 IDLE 中运行以下脚本时
import os
print(os.getcwd())
我得到的输出为
D:\testtool
但是当我从 cmd 提示符运行时,我得到了
c:\Python33>python D:\testtool\current_dir.py
c:\Python33
如何获得与使用 IDLE 相同的结果?
【问题讨论】:
标签: python python-3.x working-directory file-location