I have been looking for a solution to get the returned values of the function that executes at a scheduled time. Here is a sample function.
def get_data(dir):
df = pd.DataFrame()
file_name = "nofile"
# The rest of the body of the code executes and updates the two variables df and file_name
return df, file_name
What I want to do is to schedule this function at 6:00 AM. If the _file_name_ remains "nofile" after the execution of "get_data()" at 6:00 AM, the function should be re-executed at 6:00 PM. So like this
def sched():
# Schedule at 6 AM
# Here I cannot get the file_name as return value of get_data()
if file_name == "nofile":
# Schedule at 6 PM
file_name = "nofile"
I have no idea how to do it with APScheduler. Please help.