I used a simple code for python in my VS Studio. Print ("Welcome") when I run it through the run button it works fine but when I want to run it through typing the file name ( eg .2_hello.py) and press enter it doesn’t run and instead leave a blank line. I don’t know what’s wrong.please help
I want the python code to run through typing the file name in terminal window of vs studio just as it works fine when I use the run button to run code.
3
Answers
You need to specific the python interpreter to run your code
try:
Because you aren’t telling the terminal what that python file should do. In default it opens the file in vscode. Try this:
check if you have a file of that name on path.
also type :
python . 2_welcome.py