'How can I provide the user's desired date as input in the Python Schedule library?
I am trying to write a very simple application that will open automatically when the user enters the desired link and date. In the next step, I will write an interface with tkinter/qt5, but I have a problem. I'm able to get the link from the user but I'm not sure how to get the user to give the date they want. How can I do this with the Schedule library or is there an alternative library way?
import schedule
import webbrowser
import time
import subprocess
import os
from bs4 import BeautifulSoup
testlink1=input(" The site you want to access: ")
testlink2=input(" The site you want to access: ")
testlink3=input(" The site you want to access: ")
testlink4=input(" The site you want to access: ")
def openlink_1():
print("\n\n...Web Site")
webbrowser.open(testlink1)
def openlink_2():
print("\n\n ...Web Site")
webbrowser.open(testlink2)
schedule.every().monday.at("00:59").do(openlink_1)
schedule.every().monday.at("12:43").do(openlink_2)
def openlink_3():
print("\n\n ...Web Site")
webbrowser.open(testlink3)
def openlink_4():
print("\n\n ...Web Site.")
webbrowser.open(testlink4)
schedule.every().wednesday.at("19:07").do(openlink_3)
schedule.every().wednesday.at("18:46").do(openlink_4)
if __name__ == "__main__":
os.system("cls")
print("\n\n\t\t>>[ Program Started ]<<")
print("\n ........................................... ")
print("\n\n")
while True:
schedule.run_pending()
time.sleep(10)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
