Can you do self-executable script in Python? (Autorun)

0
Hello, I'm starting to learn Python, I know only the basics of the basics, I wanted to do a self-executable script (autorun), but I searched all over the internet and found nowhere to do an autorun in Python, so , is there any way to do this? If so, could anyone explain how and leave a sample code for me to see how it works? Thanks in advance for your response.

Incidentally, I'd rather have it in Python 3

    
asked by anonymous 01.12.2017 / 00:48

1 answer

-1

One of the options would be to use a Job Scheduler, in short it will schedule a task and when its time comes, it will be executed, it will be able to repeat or not, it depends on how you scheduled the job.

Ex lib one:

import schedule
import time

def job():
    print("I'm working...")

schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
schedule.every(5).to(10).minutes.do(job)
schedule.every().monday.do(job)
schedule.every().wednesday.at("13:15").do(job)

while True:
    schedule.run_pending()
    time.sleep(1)

Have a general introduction about.

schedule - Python job scheduling for humans.

A list of them implemented in python

    
10.07.2018 / 05:28