0

I'm attempting to code and run a python program in VSCode. I have Python 3.8.1 with vitrual env. When I click the green "play" button to "Run Python File in Terminal", the command invoked in the terminal starts with an "&" symbol, like this:

(virtual) ...tg-test> & "c:\Users\...\python.exe" "c:\Users\...\MyProgram.py"

enter image description here

When I try to remove the & it already flags a problem by turning the prompt sign ">" to red.

What is this symbol for and how can I run my code in the terminal by just calling python.exe myfile.py?

Thanks!

Mor Sagmon
  • 905
  • 1
  • 16
  • 35
  • Python is a program. When you run a python file you're calling python to run the script you've written. If you look at your environment variables you should see this path in the Path variable, this is how your machine knows where the python.exe file is so when your type "python some_script.py" it runs python.exe – DvirH Feb 28 '21 at 11:03
  • @DvirH Thanks. I am asking about the "&" sign BEFORE the call to the python program... – Mor Sagmon Feb 28 '21 at 12:19
  • See https://stackoverflow.com/questions/22074507. – Luke Woodward Feb 28 '21 at 12:28
  • THanks @Luke! just what I was looking for... – Mor Sagmon Feb 28 '21 at 13:10
  • Luke pointed me to the answer here: [https://stackoverflow.com/questions/22074507/what-does-the-symbol-in-powershell-mean](https://stackoverflow.com/questions/22074507/what-does-the-symbol-in-powershell-mean) – Mor Sagmon Feb 28 '21 at 13:11

0 Answers0