wenn etwas falsch geht, können Sie immer versuchen, um Hilfe zu rufen:
>>> help(print)
Help on built-in function print in module builtins:
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout)
Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
und es könnte Sie sehen, tha die Syntax dieses print
Sache ist print(something)
komisch ist, dass in Python 2, erhalten Sie nur eine Fehlermeldung:
>>> help(print)
SyntaxError: invalid syntax
es ist, weil in python < 3, print
Funktion war keine Funktion, sondern ein Schlüsselwort (genau wie z.B. for
Siehe [ Python-Syntaxfehler beim Drucken ] (http://stackoverflow.com/questions/826948/python-syntax-error-on-print). –
Installieren Sie Python 2.7 (oder lesen Sie die Dokumentation) –