I have a question about implementing Gui using pyqt4.

Asked 2 years ago, Updated 2 years ago, 122 views

First of all, there is a sauce that is salty from Python using opencv. The content of the source is, roughly speaking, the source that reads the image img, finds a square inside the img, and recognizes the number inside the square. And I want to make the image of the inside of the computer by implementing Gui.

Simply put, I want to create a button with GUI and click the button to select the desired image in the computer, find a square inside the image and recognize the number.

The source that finds the square inside the current image and recognizes the number is in the created state. I'm implementing the gui now. As I implemented it, I had a question.

gui and Python sauce should be combined, but this is my first time dealing with gui, so I don't know how to combine them. Gui-made is a source implemented from the source (I'll name it test.py) that imports the function name from the source and implements it, or imports the gui from inside test.py? Or is there any other way? I'd like to know about Since it is the first time for the GUI itself, even if I search, the information I want is not available, and I don't know what to do with the search term.

Guy is using pyqt4 and python 2.7. The reason why I use pyqt4 is simply because there is a designer. I stopped using it. I don't know anymore

python-2.7 pyqt gui python

2022-09-22 16:47

1 Answers

I haven't used pyqt4, but I'll just give you some advice from experience.

In this case, test.Py only implements the core function of receiving images and finding numbers, and it would be better to import test.py from the side that implements the UI, whether pyqt4 or whatever.

If there is a GUI-related code in test.py, it will be inconvenient because you have to change test.py every time you change the UI. I'm using pyqt4 now, but I might have to implement it in a different UI later.

I think finding numbers in an image is a key feature that you can use in other environments later on. I think it would be better to configure it so that the core functions can be called in and used in various environments.


2022-09-22 16:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.