I'm struggling to figure out the proper syntax in the IDE because no matter what I try, it just won't run; is anyone else having these problems?
Does anyone happen to know the solution?
Thanks,
I'm struggling to figure out the proper syntax in the IDE because no matter what I try, it just won't run; is anyone else having these problems?
Does anyone happen to know the solution?
Thanks,
Not sure exactly what you are asking, but if you want to know how to implement an "if-elif-else" statement then this should give you an idea:
def initialize(context):
schedule_function(myfunc, date_rule=date_rules.every_day(), time_rule=time_rules.market_open())
def myfunc(context, data):
today = get_datetime()
if today.weekday() == 0:
print "it's Monday"
elif today.weekday() == 1:
print "it's Tuesday"
elif today.weekday() == 2:
print "it's Wednesday"
elif today.weekday() == 3:
print "it's Thursday"
else:
print "it's Friday"
I've attached an algo which implements this. Check the logs for the output.