I have installed VS Code version 1.71.2. I have installed extension Python and Code Runner. Python programs are getting executed thru command prompt.
I opened above folder in VS code and executed manually program in terminal and it is ok. Manual execution in terminal py program.py
However my other friend is using code runner in VS code and python programs are getting executed at his end flawlessly. In my pc it is showing error. Also he get many option on right click. like below
Context Menu option in VS code
In my case right click doesn't show option like "Run Python File in Terminal" or " Run selection/line in python terminal". Also python file doesn't get executed using run button. It shows error. I have added coderunner and python extensions.
Context Menu options missing and error in python code
So my questions is :
I have tried Coderunner and python extensions. I don't know what needs to be done in settings.json file. I am expecting python execution in VS code and getting list of options in context menu on right click.
Notice that the tab icon is not two snake heads, representing a Python script, but rather a Windows icon, what it thinks is a shell script...
Also, your terminal is showing cmd /c
, not python
executing the script.
Make sure you have Python selected in the bottom right. Or change the file associations.
Or, you can create a .ipynb
notebook file instead.
Also, 1.77 is the latest VSCode, so recommend you upgrade.