PyQT GUI Testing - python

Does anyone know of a automated GUI testing package for that works with PyQT besides Squish? Nothing against Squish I am just looking for other packages. It would be cool if there were an open source package. I am doing my testing under Linux.

It looks like PyQT4 includes a QtTest object that can be used for unit testing.

WATSUP has worked for me.

You should be able to use pyunit in conjunction with PyQT.
http://pyunit.sourceforge.net/

You can use py.test with the pytest-qt plugin. There's a simple example of how it can be used here
Another alternative is to use the built-in unittest module together with QtTest (parts of QtTest has been built into PyQt). A longer example is given in this article
All of this is free and open source :)

Related

Is there a python function, that allows to move and resize windows?

I'm looking for a python module, that can move&resize windows(any windows,not just made with python).
In C there is a win32 api function, called SetWindowPos().
Is there any alternative for python.
*Web searches gave me nothing, but tk module resize function, which only works with its own(tk) windows.
There is! Based on your question, I'm assuming you're getting at something similar to the programming language, AHK. There is a python library, ahk which takes advantage of that language.
PyPi link: https://pypi.org/project/ahk/
Github link: https://github.com/spyoungtech/ahk

Installation of PyQt4

I currently begin to use Python (2.7) with Eclipse(on windows). To run my script,I would need PyQt4 but I meet some problems when I try to install it.
I downloaded
PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x64.exe,
PyQt-win-gpl-4.10.3.zip
and sip-4.15.2.zip
from the following link: http://www.riverbankcomputing.co.uk/software/pyqt/download .
I launched the execution of the first feature and a folder PyQt4 appeared into C:\Python27\Lib\site-packages.
To my mind, PyQt4 installation was finished and I simply did:
Eclipse>Preferences>Pydev>Interpreter-Python>python27>Apply
Nevertheless, when I try to import any function of PyQt4, I am said that the module name is unknown.
Could you help me to solve this problem?
Thank you very much
I want to comment for this .... but my reputation doesn't allow me to :(
anyway You could try this answer ..... (link below)
which is something like that :
Copy from This Answer
PyQt is actually a wrapping of C++ Qt libraries. So they are not .py
files an
d PyDev can't analyze them to
get what is in them. You need to add PyQt4 in the Forced Builtins tab,
so that PyDev can use a Python shell to "look into" those libraries
and know what is in them. That will also give you code-completion for
PyQt.
Apart from that, it is usually not a good practice to use from foo
import *. You'll be importing everything inside your namespace and you
wouldn't know which is coming from where. Moreover you might have name
clashes that mask each other. Though it is unlikely with PyQt, still
I'd suggest you get used to from PyQt4 import QtGui, QtCore and
reference classes like QtGui.QMainWindow.

Need Windows GUI for Python .exe script

I wrote a py .exe script and need to create a GUI for it with a file path input field, a 'cancel' and 'ok' buttons. How can I accomplish it best? Do I need to bind it with any C libraries? I know I could easily create a web based interface but I do not want a web app, I need a .exe app.
Please, help!
For such a simple GUI, Python comes with a built in library: TkInter. It's somewhat ugly, but it might be fine for your purposes - requires nothing 3rd party, so no additional installations. If you want something more full featured, I'd suggest PyQt
wxPython is the best thing I can think of.
Have a look at easydialogs for window http://www.averdevelopment.com/python/EasyDialogs.html

Python: Desktop UI for my python script

Im new to python and want to create a GUI front-end (desktop, rather than web) for my python script. The script essentially parses XML files and runs various searches over the contents (eg. accepts regex searches from the user, returns results etc).
It works well on the command line but I want to present a more user friendly interface.
There seems to be a lot of options out there - http://docs.python.org/faq/gui.html
Or should I look elsewhere?
Can someone recommend a GUI toolkit for Python?
Cheers.
I recommend using one of Tkinter, wxPython or PyQt. They are all equally suitable for a simple task. My personal favorite is Tkinter because I think it is the simplest way to get started. However, any of those would make a fine choice.
Here is a page on the Python wiki with some fifty options.
PyQt is great, although it's on GPL. There is also PySide alternative on LGPL.
You can also try wxPython or PyGTK if you don't like Qt for some reason. There is also gui library in python standard library called Tkinter, but I haven't used it and don't have any experience with it.

Best way to build a cross-platform and custom-skinned application with Python

Features needed:
A framework, allowing me to build tab-based application with custom design (like in Hotot twitter client), keeping the native os window frame.
Compatible with Python.
My application will be running under Win/OsX/Linux/.
No Flash/Flex/AIR.
I also would like to ask if PySide does meet my requirements and is it worse or better than wxPython and Tkinter mentioned already?
Use Tkinter. It works on every platform that Python supports, is relatively easy to program in, looks pretty good on most platforms, and has the features you want. It's also built-in for most versions of Python, so your users (in many cases) will not have to install any external dependencies.
I find that Tkinter looks best on Mac OSX and Windows, and slightly outdated on some Gnome desktops. The most important feature, however, is that the API is extremely clean and easy to use and it is very lightweight. PyQt has a similar feature set, but, in my experience, its performance is significantly degraded when compared to Tkinter.
PySide is Nokia's Qt binding for Python. I'm not aware of what the differences are between it and PyQt. Ultimately, most GUI toolkits for Python are going to be cross platform and support the functionality you need. I suggest Tkinter because I feel it is the easiest and most pleasurable way to program GUI applications in Python.
I am the author of Hotot.
according to your requirements, the key for you to choose a framework is the UI framework should be able to access webview conveniently.
Hotot has several wrappers for different platforms. On Linux, we have both Qt and GTK version, on Windows, we provide a Qt version, on Mac, we have a Cocoa version, and of course we have a Chrome version. In a word, all they can easily access webkit.
PS: XULRunner is another good choice for native appearance.
Additionally to the advices given by other people, I suggest you to use PyQt which is a Python binding to Qt framework. It's widely used, cross-platform and feature-full.
Take a look at wxPython (based on wxWidgets). If you want to make it web-based, look into using Django.
Well, you mentioned PyHotOt, and it says (on its web site) that it uses pywebkitgtk, and PyGTK. PyGTK/PyWebKitGTK exists for windows. Did you check it out? I think OS X would be the weak link on GTK, but maybe it's pretty good too.

Categories