In the first line of the above image you can see there is a bunch of useless fluff that I want to remove. I managed to remove the fluff in the Prompt changing it to just "$" and want to do something similar for the line where the file is executed.
CodePudding user response:
- Add
#!/opt/homebrew/bin/python3
to line 1 ofhello.py
cd /Users/julioguidotti/Documents/Harvard\ CS50P
- Make
hello.py
executable (chmod 755 hello.py
orchmod x hello.py
) - Run the file
./hello.py
.
CodePudding user response:
Perhaps it would be better to use the Debug Console instead of the Terminal then.
To do this, you need a custom launch configuration:
In the Run and Debug tab click create a launch.json file (if you don't have one already) and select the Python File template. Then, in .vscode/launch.json
change property "console": "integratedTerminal",
to "console": "internalConsole"
for the desired configuration.
Make sure to switch to Debug Console tab after you're done (Cmd Shift Y on Mac, or click the tab next to your Terminal).