admin管理员组文章数量:1401476
enter image description hereI am trying to execute my Python code on the command line in the CS50 Codespace IDE. After I enter the command, I get a "can't open file"
error message. How to I determine if I am in right directory with the faces.py
file? If I'm in the wrong directory, how do I get to the correct directory?
Image of CS50 IDE
enter image description hereI am trying to execute my Python code on the command line in the CS50 Codespace IDE. After I enter the command, I get a "can't open file"
error message. How to I determine if I am in right directory with the faces.py
file? If I'm in the wrong directory, how do I get to the correct directory?
Image of CS50 IDE
1 Answer
Reset to default 0You should start be reading the Codespace documentation. Once you do, you will find there are (at least) 3 ways to run your code:
- Click on the arrow ("Run") button near the top right corner to execute the program.
- Select the
faces.py
file in the File display (on the left) and pick "Run in Integrated Terminal" from the pop-up menu. This will change the command prompt to match the folder name. Then enter thepython faces.py
command. - Or, enter
cd faces
at the command prompt, then enter thepython faces.py
command. This has the same result as method 2 above.
本文标签: pythonHow to execute code in CS50 Codespace (correct directory and file)Stack Overflow
版权声明:本文标题:python - How to execute code in CS50 Codespace (correct directory and file) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744306193a2599805.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
/workspaces/187923852/faces.py
. Butfaces.py
is in thefaces
directory one level down. – OldBoy Commented Mar 22 at 17:24/workspaces/187923852/faces/faces.py
. – OldBoy Commented Mar 22 at 17:31pwd
command to display the actual location that your shell is at, and update your question with the details. – OldBoy Commented Mar 23 at 17:27