Jun-26-2017, 03:05 PM
Sorry for this newbie question:
I installed Python v3.6.1 on win 7. Afterwards I tried to execute the following simple python script
from webpage www.pythonforbeginners.com/code-snippets-source-code/date-and-time-script/:
D:\tools\python\python.exe dateParser.py
it yields a syntax error:
File "dateParser.py", line 17
print mm + "/" + dd + "/" + yyyy + " " + hour + ":" + mi + ":" + ss
^
SyntaxError: Missing parentheses in call to 'print'
Whats wrong?
Thank you
Peter
I installed Python v3.6.1 on win 7. Afterwards I tried to execute the following simple python script
from webpage www.pythonforbeginners.com/code-snippets-source-code/date-and-time-script/:
from datetime import datetime now = datetime.now() mm = str(now.month) dd = str(now.day) yyyy = str(now.year) hour = str(now.hour) mi = str(now.minute) ss = str(now.second) print mm + "/" + dd + "/" + yyyy + " " + hour + ":" + mi + ":" + ssWhen executing
D:\tools\python\python.exe dateParser.py
it yields a syntax error:
File "dateParser.py", line 17
print mm + "/" + dd + "/" + yyyy + " " + hour + ":" + mi + ":" + ss
^
SyntaxError: Missing parentheses in call to 'print'
Whats wrong?
Thank you
Peter