-3
votes

This is the error, I have no idea where the fault is:

> & C:/Users/tanel/AppData/Local/Programs/Python/Python38/python.exe  
"c:/Users/tanel/Documents/Projects/Coding/Python/Game Alien/game.py"
  File "<stdin>", line 1
    & C:/Users/tanel/AppData/Local/Programs/Python/Python38/python.exe "c:/Users/tanel/Documents/Projects/Coding/Python/Game Alien/game.py"
    ^
SyntaxError: invalid syntax
1
Please don't post screenshots of text. They can't be searched or copied and offer poor usability. Instead, paste the code as text directly into your question. If you select it and click the {} button or Ctrl+K the code block will be indented by four spaces, which will cause it to be rendered as code. - Chris

1 Answers

6
votes

You're getting a Python SyntaxError because you are trying to run a PowerShell command in the Python shell:

>>> & C:/Users/tanel/AppData/Local/Programs/Python/Python38/python.exe "c:/Users/tanel/Documents/Projects/Coding/Python/Game Alien/game.py"

exit out of that shell and then run your PowerShell command in PowerShell. The prompt should look something like

PS C:\>

The Python shell is for running code interactively, e.g. you could type something like import pygame or print("Hello, world!") directly into it.