将导入更改为从导入后,我遇到了这个错误:
from datetime import datetime, date, timedelta
today = date.today()
from time import mktime
from feedparser import feedparser
import settings
def check_calendar():
d = feedparser.parse(settings.personal_calendar_feed)
for entry in d.entries:
if(date.fromtimestamp(mktime(entry.date_parsed))==today):
Traceback (most recent call last):
File computer.py", line 734, in <module>
check_calendar()
File "computer.py", line 210, in check_calendar
if(date.fromtimestamp(mktime(entry.date_parsed))==today):
AttributeError: 'function' object has no attribute 'fromtimestamp'