[PyQt] why use the non-gui Qt classes in Python
Kyle Altendorf
sda at fstab.net
Sat Aug 18 15:29:03 BST 2018
On August 18, 2018 6:23:38 AM EDT, J Barchan <jnbarchan at gmail.com> wrote:
>On 18 August 2018 at 04:10, Kyle Altendorf <sda at fstab.net> wrote:
>
>>
>>
>> On August 17, 2018 8:18:41 PM EDT, Christopher Probst <
>> christop.probst at gmail.com> wrote:
>> >These are really great responses. Thank-you so much.
>> >
>> >In general, I personally take the non-Qt option unless Qt offers a
>> >specific
>> >> benefit. I'm much more likely to want to leverage my existing code
>or
>> >> library knowledge without Qt than without Python.
>> >
>> >
>> >I must ask: Why beyond the reason of expanding library knowledge
>would
>> >you
>> >prefer the non-Qt option? Are there technical reasons like
>performance,
>> >reliability or maintainability?
>>
>> They'll be more 'pythonic' generally. You'll get exceptions,
>iterables
>> instead of getWidgetByIndex() functions, yield/await sequencing, etc.
>Sure,
>> also easier to contribute to a Python native library in various
>regards,
>> I'd expect. The libraries will be in common use because they are
>good on
>> their own instead of because they happen to already be present as
>part of a
>> big system ( in other words Qt, though the same idea applies to not
>> considering stdlib modules inherently better than third party). I'm
>not
>> saying I'm against Qt stuff, just that I have a tendency away when
>there
>> are good options. Oh, and you are less likely to lose PyPy as an
>> alternative to CPython when you want to use the same library without
>PyQt.
>> :]
>>
>> Cheers,
>> -kyle
>> _______________________________________________
>> PyQt mailing list PyQt at riverbankcomputing.com
>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
>Why would I use QSQLDatabase, the network module if Python offers it
>> already?
>
>
>I think Florian has already mentioned this, but doing a lot of database
>stuff I found the Python library ("mysql", I believe) awfully low-level
>compared to what the Qt SQL classes offer. Both for backend & frontend
>(GUI) functionality, i.e. not *only* because I want to show it in a
>QTableView.
Sure, maybe you want sqlalchemy or such over your DB driver. Though with either there's the async issue. I forget what async sqlalchemy options there may be.
More information about the PyQt
mailing list