0

I'm wish to use the schedule module, as shown here, in a way that code read schedule parameters from a text file, for example:

start_day=1,2,3,4
start_time=09:00

module's syntax is as follows (wish to change days, and job):

schedule.every().monday.do(job)
schedule.every().wednesday.at("13:15").do(job)

my first get was to use getattr() - but it is for a more simple uses, such as shown here

Appreciate any help

guyd
  • 693
  • 2
  • 14
  • 32
  • I don't understand the question (probably because there is no question). What's wrong with `getattr`? Doesn't it do what you want? – Aran-Fey Sep 20 '18 at 10:35
  • @Aran-Fey - as far as I understand you can use `getattr` to set one parameter, as shown in example -`getattr(x,'foo')` is identical to `x.foo`, the `schedule` function is constructed of more parameter. – guyd Sep 20 '18 at 10:40

1 Answers1

0

that is what I was looking for:

for day, entries in activeSched.iteritems():
                for i, entry in enumerate( entries ):
                    getattr( schedule.every(), day ).at( entry[ 0 ] ).do( setScheduledTemp, entry[ 1 ] )
guyd
  • 693
  • 2
  • 14
  • 32