Can asyncio be combined with PyQt5?

ullix ullix at urkam.de
Sat Oct 28 13:15:18 BST 2023


My PyQt5 app so far runs well. But trying to add functionality requiring 
asyncio results in failure.

I tried to integrate the telegram-bot function (pip: 
python-telegram-bot). When using the old version 13.15 I got it running, 
but I am swamped with deprecation warning. But the new version 20.6 
mandates the use of asyncio, and here is where I lack understanding; I 
can't get it to work.

This is working code of the old app:
ex=ggeiger()
... classggeiger(QMainWindow):
def__init__(self):
"""init the ggeiger class"""
super().__init__()
Adding async and await all the way up to this point works, but with e.g. 
this (and other attempts) it fails:
ex=await ggeiger()
... classggeiger(QMainWindow):
async def__init__(self):
"""init the ggeiger class"""
await super().__init__()
I guess it is possible? Any pointers welcome?
ullix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20231028/c1994022/attachment.htm>


More information about the PyQt mailing list