May-03-2018, 10:59 AM
I'm a python newbie and need a little help with my code.
I need to convert my code to use APSCHEDULER and not SCHEDULE module because I need to use hours, minutes, seconds which SCHEDULE is not capable of. How can I convert this script to use hh:mm:ss ?
Note: I did read the apscheduler documentation and examples, and oddly enough there isn't anything about scheduling a job to run at exactly 7:45:30 PM. All the examples appeared to be geared towards cron jobs running every seconds=3.
Here is my code for schedule-module
I need to convert my code to use APSCHEDULER and not SCHEDULE module because I need to use hours, minutes, seconds which SCHEDULE is not capable of. How can I convert this script to use hh:mm:ss ?
Note: I did read the apscheduler documentation and examples, and oddly enough there isn't anything about scheduling a job to run at exactly 7:45:30 PM. All the examples appeared to be geared towards cron jobs running every seconds=3.
Here is my code for schedule-module
import subprocess
import time
import schedule
def job1():
subprocess.call("netsh interface portproxy add v4tov4 listenaddress=192.168.0.153 listenport=1101 connectaddress=192.168.0.153 connectport=809 protocol=tcp", shell=True)
def job2():
subprocess.call("netsh interface portproxy reset", shell=True)
schedule.every().day.at("06:00").do(job1)
schedule.every().day.at("07:00").do(job2)
