[PyQt] Feature request: make python's file-object and QFile interexchangable

Florian Bruhin me at the-compiler.org
Mon Oct 19 21:16:35 BST 2015


* Ilya Kulakov <kulakov.ilya at gmail.com> [2015-10-19 16:09:56 -0400]:
> Would be nice if one use QFile where one can use file-object.

I needed the same thing the other way around, i.e. using a file-like
object for a QIODevice - so I wrote a wrapper:

https://github.com/The-Compiler/qutebrowser/blob/master/qutebrowser/utils/qtutils.py#L239-L383
https://github.com/The-Compiler/qutebrowser/blob/master/tests/unit/utils/test_qtutils.py#L523-L921

Maybe it's useful for someone :)

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151019/f33e8795/attachment.sig>


More information about the PyQt mailing list