Screen Call Bug

1

Hello! I created a function that calls a screen (urban) when the trigger (Trigger) is triggered, but when the function is executed it automatically closes the screen that was opened (I wonder why this happens, if it is just a or if it terminates the function as soon as the program executes the task (task) this function was done in pyqt and python 3.4

  

the trigger function was copied from: How to perform a task at a precise time in time?

def maketime(self, trigger):#,dateTimeEdit):
    dt = self.dateTimeEdit.dateTime()
    dt = dt.toPyDateTime()
    now = QtCore.QDateTime.currentDateTime().toPyDateTime()
    now = datetime.now().replace(microsecond = 0)
    trigger = time.mktime((dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, 0, 0, 0))#Gatilho
    print(trigger)  
    # até aqui o sistema funciona

    def task(trigger):
        sys.stdout.write("Tarefa executada com um erro de " + str(time.time() - trigger) + ' segundos\n')
        urban(self)
    s = sched.scheduler(time.time, time.sleep)
    s.enterabs(trigger, 0, task, argument=(trigger,))
    t = threading.Thread(target=s.run)
    t.start()
    
asked by anonymous 25.09.2018 / 05:53

0 answers