How can I delay but not time.sleep?



  • Hi all,
    I programming on python and
    I do a program white use a Pyqt5.
    How can I delay (style time.sleep(1)) but not time.sleep some anther func.
    I use imports:

    import PyQt5 - All
    import pyglet
    import numpy as np
    import time
    import cv2
    import datetime
    import dateutil  
    

    Plese help. tnx!



  • @Dl10 said in time.sleep...:

    how can i delay (style time.sleep(1)) but not time.sleep some anther func.

    Someone else may understand what you mean by this, but I'm afraid I do not... Care to clarify?



  • @Dl10
    You may split the function and start a timer.. something like..
    from :

    testFunction(){
      step1..
      step2..
      time.sleep()..
      step3..
    }
    

    to

    testFunction(){
    step1..
    step2..
    qtimer t;
    connect(&t,SIGNAL(timeOut()),this,SLOT(testFunction2()));
    t.start(2000);
    }
    testFunction2(){
    step3...
    }
    

    PS: Syntax may vary.. this is a c++ code.. please convert it to pyqt5.. Hope this is what you are expecting...
    and thats what i understood from your post...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.