[PyQt] wx.MilliSleep equivalent

Kyle Altendorf sda at fstab.net
Fri Sep 21 22:20:31 BST 2018

On September 21, 2018 4:50:35 PM EDT, Florian Bruhin <me at the-compiler.org> wrote:
>On Fri, Sep 21, 2018 at 03:51:15PM -0400, Tong Zhang wrote:
>> Thanks Jones, QTimer.singleShot is a nice solution if you have
>nothing to do
>> after this single line of code, or the right after consecutive code
>will be
>> executed before the callback wrapped within singleShot method, which
>> sometimes is not wanted.
>You can continue doing whatever you want in the method connected to the
>slot, though.
>Ideally you could use Python's async support (native since 3.5, via
>"yield" before that) with PyQt5.
>Kyle Altendorf (altendky) was working on something like that here:
>but that also involves Twisted. I'd like to have something like that
>only using native Qt stuff. Maybe one day... :D

I do use twisted with pyqt5, but there is an asyncio option in there as well.


More information about the PyQt mailing list