Python - Date and Time: AttributeError: 'module' object has no attribute 'month'

后端 未结 5 1112
醉话见心
醉话见心 2021-01-20 21:41

This is my calendar code in Python and I have saved it to my folder as calendar.py.

import calendar
a = calendar.month(2016, 3)
print (a)
print          


        
5条回答
  •  伪装坚强ぢ
    2021-01-20 22:27

    The problem is that you used the name calendar.py for your file. Use any other name, and you will be able to import the python module calendar.

提交回复
热议问题