Python:导入日历错误会产生意外结果

时间:2019-05-25 08:32:35

标签: python-3.x

询问执行后我的代码中没有的其他内容

import calendar
y = int(input("Input the year : "))
m = int(input("Input the month : "))
print(calendar.month(y, m))

文件名我写为calen.py

E:\pyprogs>python calen.py
Enter a string: df
fd
Traceback (most recent call last):
  File "calen.py", line 1, in <module>
    import calendar
  File "F:\Anaconda\lib\calendar.py", line 10, in <module>
    import locale as _locale
  File "F:\Anaconda\lib\locale.py", line 180, in <module>
    _percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?'
AttributeError: module 're' has no attribute 'compile'

我希望日历会被打印。

0 个答案:

没有答案