-2

I'm using python 3.7.3, when I try to run a saved .py file this happens

C:\Users\olive>cd desktop

C:\Users\olive\Desktop>hello.py
 File "C:\Users\olive\Desktop\hello.py", line 1
   Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
             ^
SyntaxError: invalid syntax

Does anyone know how to fix this, thanks

ForceBru
  • 43,482
  • 10
  • 63
  • 98
  • Why on Earth does your file contain _literally_ "Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32"?! And how did it even get there? Please show the contents of `hello.py` – ForceBru Jul 07 '19 at 10:53
  • @ForceBru My bet is on a modified version of `print sys.version` and there is a version check inside the .py file where both side of the if-statement do not match in a try/except-loop resulting in a SyntaxError thrown back at OP. Probably matter of incorrect string manipulation prior to comparison of sides. Ohole.. post script part please. – ZF007 Jul 07 '19 at 11:04

1 Answers1

0

try :

python3 hello.py

I think will be running