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.
/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