Home > Software design >  In vs studio python Print ("Welcome") it does not run when I type the file name
In vs studio python Print ("Welcome") it does not run when I type the file name

Time:10-31

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 .\02_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. enter image description here

CodePudding user response:

Because you aren't telling the terminal what that python file should do. In default it opens the file in vscode. Try this:

python 02_welcome.py

CodePudding user response:

You need to specific the python interpreter to run your code try:

python ./02_hello.py

CodePudding user response:

check if you have a file of that name on path. also type : python .\02_welcome.py

  • Related