Using python how do I manage windows on OSX - python

I am trying to manage windows using python.
Specifically I am trying to find a window that I have opened using selenium then have it focused and maximise it. I believe this is possible using a window manager as there are programs like qtile written in python.
I have read on the python documentation that there is something called pythonw.
https://docs.python.org/3/using/mac.html
I am using python 3.5 but I can upgrade if this is an easier option.
How do I use this on OSX?
Is there a library or are there any more resources on this subject?
I would like to learn how to use simple window management in python for osx.
Any help is appreciated.

You need a system level window manager for this

Related

Is there an easy way to use pyautogui?

I made a python program with pyautogui. I want to release this to my friends. But they seldom want to download python and pyautogui. I wanna know how to run this without downloading these programs. Or can you explain me an easier way to use pyautogui for my friends (without using pip).
You can create a standalone application so that they can run it on their device.
for Windows you can use Py2exe
for MacOs you can use Py2app

Equivalent of pywinauto library for debian

I'm looking for an equivalent Python library that will work when I run my script on Raspberry Pi. I'm under the impression that pywinauto only works on windows machine.
I want to control some inputs to a GUI launched by my script, using my script. Apart from pywinauto I have no idea how to do this. I thought about using command line to control the software directly, but if there is a simpler way I would really appreciate knowing about it.
Thanks for your time.
ATSPI is an Linux accessibility technology to obtain GUI text/rectangle properties programmatically. See how to find and run ATSPI registry daemon and how to enable ATSPI for the most popular types of GUI apps. Usually it's
$ /usr/libexec/at-spi-registryd &
There is a Python bindings for ATSPI. See this answer for details:
How to install pyatspi?
The pyatspi package has too many dependencies like pygobject etc. It also requires some compilation during installation steps. We think this is not user friendly so we decided to use libatspi.so directly (without any dependencies). This work status can be tracked here: https://github.com/pywinauto/pywinauto/pull/449
There is no exact deadline for pywinauto 0.7.0 with this feature (it's a hobby project), but I would say this summer sounds realistic.

Making python terminal user interface

I'm trying to make terminal user interface with python which I will use it as post installation script for min linux os. But I don't want to use ncurses or urwid because it feels like overkill. I'm looking more in whiptail or screen direction. But I don't know is it better to call ui terminal rendering from python subprocess or to use it with python bindings like pythondialog, here are the reasons for my doubts.
Is whiptail/screen available on every minimal linux image... subprocess should be better suited for my program.
pythondialog requires installation of python3-dialog package. Since I want to make a postinstallation program for linux min image I want to use dependencies as little as possible.
What would you suggest for my problem?
Maybe npyscreen is what you are looking for, but i havent tried it. It just installed for me in fresh 2.7 virtualenv with zero dependencies - EDIT: sorry no, it runs on top of ncurses.
I've had a similar notion about ncurses or urwid. You might want to try:
prompt toolkit - focus on UI, comes with tons of examples
asciimatics - handy for UI and animations, also with a bunch of helpful examples
Both have a responsive and active community.

Command line portable application

Not sure if this is the location to ask this, so please close or move as appropriate.
We are bundling Python2.7 64-bit and a number of python libraries (GDAL, SciPy, Numpy) into an application (py2app / pyinstaller). I wonder if it is possible to create a stand alone terminal that has access to the installed libraries, but not the system libraries. This would be akin to FWTools.
The goal is to allow the user to open a command prompt within the GUI and have access to all of the libraries within the application a la a virtual environment.
For example, a user with GDAL 1.8 installed could download this application, launch a stand alone command line and utilize our build of gdal 1.9.1 from within the application.
Any references would be appreciated as we are just considering this approach and are unsure of the feasibility.
We are writing this in python.
There isn't a very easy way to embed a console / terminal into any of the GUI frameworks. The closest I've heard of is PyGTK's VteTerminal. You might be able to use Python's curses library, but I haven't been able to find any good ways to wrap that in a GUI either.
If all you want is a Python shell, you might be able to use wxPython's PyShell or PyCrust widgets. Those are pretty straight-forward.

Writing Windows GUI applications with embedded Python scripts

What would be the optimal way to develop a basic graphical application for Windows based on a Python console script? It would be great if the solution could be distributed as a standalone directory, containing the .exe file.
As far as I understand your question, you want to write a graphical windows application in Python, to do this I suggest using wxPython and then py2exe to create a standalone exe that can run on any machine without requiring python to be installed
The following tutorial shows everything step by step: Quickly Creating Professional
Looking Application Using wxPython, py2exe and InnoSetup
I would recommend that you use IronPython, which is Microsoft's implementation of Python for the .NET framework.
Tkinter is quick and easy to use. Tkinter is in the Python standard library.

Categories

Resources