Cleaner async I/O syntax with Qt
patrickkidd at gmail.com
Mon Dec 20 18:20:23 GMT 2021
I am using QNetworkAccessManager / QNetworkRequest for my async http requests. I am trying to find a way to wrap these in a cleaner python syntax. My first though was an async context manager, effectively like this:
with qt_request('https://google.com <https://google.com/>') as response:
# executed later
# executed now
I have been reading the docs on async context managers, but haven’t gotten the concepts into my head yet. Probably because I don’t fully get the async and await keywords yet either. Maybe this is actually counter to the python language spec?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt