[Tutor] What is the correct way of signalling and slots in PyQt5?

Alan Gauld alan.gauld at yahoo.co.uk
Wed Apr 3 06:05:40 EDT 2019


On 03/04/2019 09:57, Ali M wrote:
> The application crashes without errors every time any signal is called

It's very unusual to get no errors at all. How are you running it?
Are you using an OS terminal? It may be that you are simply
not seeing the errors...

However...

This list is for the core Python language and standard
library and PyQt is not part of that so you may get a
better response on the PyQt forums.

> here is the full code:

I tried running this but (after commenting out the database stuff)
only got the last QTtextEdit widget on screen with no other widgets
visible. Other than that it ran OK insofar as it didn't crash in any way.

A small point:

>         for i in word_to_esp:
>             if user_input.__contains__(i):

It's considered bad practice to call a dunder method directly.
This should be written as

       if i in user_input:

Which is easier to read.

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list