gpt4 book ai didi

python - 如何在 Python 中使用日历类?

转载 作者:太空宇宙 更新时间:2023-11-04 03:12:47 25 4
gpt4 key购买 nike

我是编程新手。当我在 IDLE3 shell 中输入以下代码时,它工作正常。当我保存它并将其作为模块运行或通过终端运行时,它返回以下错误:

File "/home/pi/Python_Programs/calendar.py", line 4, in calendar.prmonth(2016, i) AttributeError: 'module' object has no attribute 'prmonth'

这是我的代码:

import calendar

for i in range(1, 13):
calendar.prmonth(2016, i)

请告诉我我做错了什么?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com