Are there any free alternatives to the Ranorex library (Python, Windows)? - python

I am interested in the Python one. I wish to automate some GUI under Windows. What is the best open source library for that with no strings attached? Thanks.

Try pyWinAuto.

There's WATSUP, but I've not tried it yet myself.
I've also heard of pyWinAuto, although the link I have is to pyWinAuto on SourceForge.

Related

Is there a Python function for creating a desktop shortcut?

I just made a little Python project, then used PyInstaller to convert it to a .exe. I want to create a shortcut to the desktop when the user downloads it from an HTML page I made. Any way to do this?
The best way to go about this is to set up a windows installer for your python program. This installer can also be made in python, by the way, this method is fairly unorthodox since you would not make windows style apps with python.
https://python101.pythonlibrary.org/chapter44_creating_an_installer.html
I recommend you take a look at the link above, it gives a good guide on creating an installer for your program as well as how to package it properly.
Hope it Helps :)

socket.fromfd for Windows

I am porting a Python-based web server from Linux to Windows. There is a call to socket.fromfd, which is only available in Unix and I've been trying to find a Windows-equivalent with no luck.
I came upon WinSock and WSADuplicateSocket, but these don't seem to be available in Python based on this post: Can I use the winsock api from python?
I know there is also DuplicateHandle, but it is not reliable for sockets. Is there any reliable way to reproduce socket.fromfd for Windows?
I think there is a patch for this issue, for python windows. I haven`t tried it personally, but this link might help :
http://bugs.python.org/issue1378

PyGObject in Python 3 on windows

Does anyone know if its possible to install PyGObject/Gtk+3 on windows for Python 3? I have found installers on gnome's website for Python 2 (here), and several statements that it works with Python 3 (e.g. here), but no installer. The compilation instructions all seem to use jhbuild, which from what I can make out is a linux tool. Do I need to compile PyGObject to get it working, and if so, how? Or is there an easier way? What would be great is a guide or howto, but such a ting doesn't seem to exist.
Since this is the most rated question in the topic, I'd like to update the answer. Here is available installer for windows 32bit:
It contain complete SDK-like package. And complete libraries collection too. http://sourceforge.net/projects/pygobjectwin32/files/pygi-aio-3.10.2-win32_rev10-setup.exe/download
I searched for the same thing not so long ago. I couldn't really find much information but this other post
I ended up giving up on GTK+ and switch to xwpython which is really os independant
did you try the offical pypi page https://pygobject.readthedocs.io/en/latest/getting_started.html
I was able to install GTK

Automate downloading a file in Firefox using Python

I'm researching about pywinauto and pywin32. I want to write a script to automate downloading a file in Firefox. When downloading a file in Firefox, it will show a popup to ask you to open or save the file, and you have to choose an option and follow steps. How can I locate controls (items) on this popup by using pywinauto or pywin32?
You should investigate selenium ide. You can use that and Python to automate much of firefox. The forums there should point you in the right direction. This downloading issue is a persistent one.
good luck!
pywinauto installation has an example (SaveFromFirefox.py) related to this:
http://pywinauto.googlecode.com/hg/pywinauto/docs/getting_started.html
You might check out Project SIKULI from MIT. With it you can write macros by taking screenshots. The project screenshots make the entire process look dead easy. It's Python-based, too, so it may be the write tool for the job.
Also, if you have control of the computer in question, you may be able to check the box in the download popup that says "Do this every time" (or whatever the exact wording is). Perhaps that will be enough to make the job simpler?
For latest Firefox version you can use pywinauto 0.5.x (just download and run python setup.py install or run pip install pywinauto). SaveFromFirefox.py was adapted for Win7.
Useful tips:
app.Dialog.PrintControlIdentifiers() will print all possible access names for the controls on a dialog.
SWAPY is a GUI helper for the controls hierarchy inspection and code generation for pywinauto.
app.Dialog.ControlName.WrapperObject(). ... will give you the most useful list of methods available for the control. In a production code the WrapperObject() call can be omitted.

What's a good embedded browser for a pygtk application?

I'm planning on using an embedded browser in my pygtk application and I'm debating between gtkmozembed and pywebkitgtk. Is there any compelling difference between the two? Are there any third options that I don't know about?
It should be noted that I won't be using this to access content on the web. I'm mainly using it for UI purposes.
My priorities are:
It needs to be stable.
It needs to be cross-platform.
It should be easy to use.
It should be actively maintained.
It should be extensible.
It should be fast.
gtkmozembed is not available on Windows, although you can use the gecko embedding interface directly. This would require you to write some C++ code.
As far as I know, the gtk webkit port is not available on Windows yet, and still appears to be undergoing a lot of change.
For an example of a cross-platform gecko embedding solution, check out Miro.
Miro is python, and they've written just a couple of C++ classes to embed gecko on Windows, while using gtkmozembed on linux.
if you judge by the web pages then definitely pywebkitgtk
pygtkmoz from this page
"Note: this project is no longer maintained. Please use gnome-python-extras (http://www.pygtk.org) instead. I apologize for any trouble this might cause, but this is better in the long run. Python bindings for GtkEmbedMozilla."
and pywebkitgtk looks like active project changes

Categories

Resources