路径必须弄乱,我无法修复。
在命令提示符下,我试图打开并运行在IDLE中创建的python程序。我正在运行Python 3.8.5。根据自动完成无聊的工作,我应该能够做到:
var cur = 0
function getImg() {
var img= new Image ()
img.src = "image (" + (cur++) + ").jpg"
img.onload = () => {
fotos.appendChild(img)//or other span elements etc that have img as a child
getImg()
}
//if you want to know when it ended then you can use .onerror
img.onerror = () => console.log("done")
}
getImg()
但是当我这样做时,我得到了:
py birthdays.py
我所有的脚本都位于:C:\Users\name\AppData\Local\Programs\Python\Python38-32\python.exe: can't open file 'birtdays.py': [Errno 2] No such file or directory
。
我唯一想到的是它走得太远了,搜索C:\Users\henri\AppData\Local\Programs\Python\Python38-32
而不是python.exe
。但是我什至不知道它能那样工作。
我尝试使用以下方法添加确切路径:
Python38-32
但是当我这样做并按Enter键时,没有任何反应。
答案 0 :(得分:0)
当我想使用CMD运行python脚本时,我只是使用
cd\
备份驱动器C的主根,然后使用
cd folderAddress
几次,直到到达包含文件夹的确切脚本。最后,我输入
python scriptName.py
答案 1 :(得分:0)
在命令提示符下键入python。输出应为python 3。**(取决于您的python版本)。
如果您看到python版本,则工作正常。在命令提示符下,使用 cmd 命令导航到您拥有python文件的文件夹。然后输入
python birtdays.py
别忘了python之后的空格。