我下载了python 3.3。我只是在学习 python,想用实际的 IDE 来尝试一下。我想打印日期和时间。当我输入 print _时,它说语法错误。请检查代码或语法是否有问题:
>>> from datetime import datetime
>>> now = datetime.now()
>>> print now
SyntaxError: invalid syntax
>>> from datetime import datetime
>>> current_year = now.year
>>> current_month = now.month
>>> current_day = now.day
>>> print now.month
SyntaxError: invalid syntax
>>> print now.day
SyntaxError: invalid syntax
>>> print now.year
SyntaxError: invalid syntax