When I’m trying to run my main.py file through VSCode terminal, it works fine if i use py main.py but shows the prompt of "how do you want to open this file?" when i use python command instead of py.
this issue is specific to vs code terminal. both py and python works fine on my windows terminal.
here’s what i tried-
- selected interpreter path
- multiple reinstallations of python and vscode
- checked system env path-> all set well
- checked aliases
- doskey python=py
what am i missing here?
2
Answers
Try to create a folder and use IDLE to create a file and run that file in VS Code.
In the command line try: python3 path/to/file/main.py
You can get the correct relative path to your file by right clicking on the file in VSCode and selecting ‘Copy relative path’.