I am building a program in Python which will help me to join my online classes on time. I have several files of the monday classes - friday classes. The code I wrote for the days are like this:
import schedule
import time
import webbrowser
import keyboard
from time import sleep
def computer():
webbrowser.open('zoom_link_for_class')
sleep(3)
keyboard.press('tab')
sleep(0.2)
keyboard.press('tab')
sleep(0.2)
keyboard.press('enter')
sleep(7)
keyboard.write('224455')
sleep(0.1)
keyboard.press('enter')
def english():
webbrowser.open('englishclasszoomlink')
sleep(3)
keyboard.press('tab')
sleep(0.2)
keyboard.press('tab')
sleep(0.2)
keyboard.press('enter')
sleep(7)
keyboard.write('224455')
sleep(0.1)
keyboard.press('enter')
schedule.every().monday.at("08:40").do(computer)
schedule.every().monday.at("11:41").do(english)
while True:
schedule.run_pending()
time.sleep(1)
Now, I want to create a python file, which will check if it is Monday or Tuesday or Wednesday or Thursday or Friday, and then run the file created for the day. For example in monday it should run mon.py and so on. How can I do this?