[英]How can I get the correct case when calling Python's os.getcwd()?
[英]How do I get Python and Python in Visual Studio code to output the sem when using os.getcwd()?
我想让使用不同用户名在不同设备上编辑我的代码变得更容易,所以我决定改变我的代码知道我的文件位置的方式。 我决定使用os.getcwd
而不是使用整个文件路径,但是当我在 Visual Studio Code 中运行它时,我只得到C:\Users\Name
而当我只使用 python 运行它时,我得到C:\Users\Name\Yuna-Discord-Bot
。 对于两者,我都使用相同的代码:
import os
test=(os.getcwd())
print(test)
input("Enter to close")
有什么方法可以让他们将 Visual Studio Code 设置为与 python 相同,反之亦然?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.