[Python] Execute Python function as on time depend execution

Discussão em 'Python' iniciado por Stack, Janeiro 19, 2025.

  1. Stack

    Stack Membro Participativo

    I am new here so let me describe the concept first.

    I have a function:

    if timenow == 10Pm : -> do something
    elif timenow is 5min before 10pm than wait for the 10 pm and then execute the function
    elif timenow is just after 10pm then directly execute the function
    or
    if timenow == 11Pm : -> do something
    elif timenow is 5min before 11pm than wait for the 10 pm and then execute the function
    elif timenow is just after 11pm then directly execute the function


    The function should execute as above.

    But the problem is if I set everything up the following error occurs:

    if I set the function to be execute after 10pm then I can't implement the function before 11pm.

    Anyone having the concept ?

    Continue reading...

Compartilhe esta Página