i am not getting any output whenever i try to execute any basic command , in python using VS code.
CodePudding user response:
You seem to be trying to run python while already in python. Try opening a bash or cmd terminal and typing in python main3.py
CodePudding user response:
Your Visual Studio Terminal has Python already opened, so when you try to execute the:
& "C:/python 39/python.exe" "C:/route_to_your_file.py"
Is trying to execute a line of code with this, something that has a bad python syntax.
You have two options:
Close python writing
exit()
and then run your python script with"C:/python 39/python.exe" main2.py
or"C:/python 39/python.exe" main3.py
Work directly with the application of python. In that case you can write your code directly on the terminal
print("hello world")
you can (but it is not recommended) import your files as packages, with:
import main2
import main3
Since you are new on python, I recommend you the first option.
CodePudding user response:
Run the code directly:
rather than get into python then run the code: