I am trying to make a script where my zoom classes would auto open based on the schedule.
I made a module named schedule which contains separate lists of each weekday's routine.
In the main file, I made a dictionary where the key is the integer value we get after using datetime.today().weekday() and the value is its corresponding weekday's name such as {0:monday}
In my function, if today's weekday integer value matches with the dictionary key, then it will call its corresponding value weekday from the schedule module. But when I run it, it's saying " AttributeError: module 'schedule' has no attribute 'value' "
Here's part of my code for reference
#Monday=0, Tuesday=1 , Wednesday=2, Thursday=3, Sun=6.
weekday = {'1':'tuesday',
'2':'wednesday',
'3':'thursday',
'6':'sunday',
'0':'monday'}
#Function for opening and closing link in webbrowser.
def open_webbrowser():
global activation
day = datetime.today().weekday()
for key, value in weekday.items():
if int(key) == day:
for i in schedule.value:...
And here's the schedule module. I replaced the original links with 'zoomlink'
#Class routine.
sunday = [
[zoomlink,'09:01','09:39'],
[zoomlink,'10:01','10:39'],
[zoomlink,'11:01','11:39'],
[zoomlink,'12:01','12:39']
]
monday = [...]
tuesday = [...]
wednesday = [...]
thursday = [...]
question from:
https://stackoverflow.com/questions/65894624/using-variable-to-get-list-from-imported-module 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…