[英]Python in command prompt doesn't work, but in python idle it does
Copy the following at the beginning of your code to set the working directory to the same as the script's directory:在代码开头复制以下内容以将工作目录设置为与脚本目录相同:
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.