Instapy: Randomly schedule a job within a given hour.

Created on 4 Apr 2018  路  1Comment  路  Source: timgrossmann/InstaPy

I'm playing with the python scheduler but I haven't found a way to randomly schedule Instapy within a given hour.

With the following code the bot will start always at 6:35.
schedule.every().day.at("6:35").do(job)

Is there a way to randomize the minutes so that the scheduler will trigger at 6 between 6:_30_ and 6:_40_?

Most helpful comment

Just found the solution...

schedule.every().day.at("6:" + str(random.randint(30,40))).do(worker)

>All comments

Just found the solution...

schedule.every().day.at("6:" + str(random.randint(30,40))).do(worker)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

46960 picture 46960  路  3Comments

ghost picture ghost  路  3Comments

deronsizemore picture deronsizemore  路  3Comments

neomh picture neomh  路  3Comments

n0sw34r picture n0sw34r  路  3Comments