Running seperate python scripts in same window - python

I have build a game in python, which uses OpenCV to fingerspell letters.
Through the first iteration of the program I have stumbled upon a problem regarding creating a GUI interface.
The problem is that I am using two python script one for recognition and one for displaying what the user currently fingerspelled.
I would like to make the two scripts run in a shared GUI like tKinter or PySimpleGui but without succeding.
I have used threading to run both python scripts to share data between them. As of now my solution is to click on the other window between letters which is not optimal.
Window for recognition:
Window for results:
So I would like the two windows to get merged into one is this possible in any way?

Why do you need this to be multithreaded?
Inside your game simply take a picture of the person on each draw loop and get the letter from that image.
If you need to display it you can always blit it to your pygame surface.

Related

How to make a only 1 window GUI in python?

I am trying to make a GUI in python that only consists of 1 window. I think this is better explained with examples. If you have say the settings app open on the computer when you click an option a new window doesn't pop up, the original window changes the a new layout. Is there a way to do this without deleting everything in the window and then adding new stuff, and when going back doing the same process.
If you're using a QT based gui framework like PyQT or PySimpleGUI, you can accomplish this task using a Tab object. Here is a link to a sample program with using Tabs in PySimpleGUI
PySimpleGUI is a really good option for getting your feet wet with GUI development in Python. You can get a lot done with very little code and learn about how GUI's work.

Making a game overlay in python

So I am trying to make a python script that when I do a certain hotkey combination, It shows a text box as an overlay like what "Geforce Experience" and "Windows Gamebar" do.
the problem is that in the game when I interact with the text-area loses focus and goes minimized as opposed to the 2 programs I spoke about before, for example windows game bar allows you interact with a lot of options while the game is still on foreground and you close the bar you are left with whatever you were with before...
I'm using tkinter for now, and if there are solution not including tkinter it is Ok as long as it achives the goal.
As far as I understand what you are trying to do is create a overlay for a game and the overlay should be created using tkinter object. Here is a library that can do that, however as far as I remember you needed to change something in it's python file, however this might have already been fixed.

interacting with a user created gui dynamically using python

There is a user created GUI which is an .exe that loads a DLL. This GUI has a bunch of sliders, check boxes etc. I would like to move two sliders at the same time using python automatically without me using my mouse to move the sliders. I would like to know the python modules that an be used to achieve this purpose.
You can try using SikuliX.
It can be used to automate mouse or keyboard actions based on pattern matching. It is originally developed for Java I think, but it can be used with Python.
Basically, anything you can do yourself manually can be done with it.
The developer seems to be pretty active, so you can easily seek help from him if you have issues.

Python 3, capturing key combinations

I am writing long running program with simple GUI, the 99% of time I would like the program to work only as process, however sometimes I want to check the status, so is it possible to capture the keypress event in python?
For example I want to show the program window when I press Ctrl+Shift+Alt+Q, I expect to use app on Windows
Thank you
There are tutorials on how to create a key-logger with Python. They should help. But I do not know if that is the right way to go.
Also you could register shortcuts under a key combination on Windows.
You should be aware that Ctrl+Shift+Alt are handled independent of the keyboard layout and Q changes with the language.
With pywin32 you should be able to do that using Ctrl+Shift+Alt+F1 for example.

In Python, how do I make my code run in a custom sized window?

I need to know the CODE to change the size of the window that comes up when I run my python file. I am making a chess game using text, and the size of the board is too tall to fit in the little window that comes up when I run my code. I don't want to have to do it manually, I need to make it a specific size so that I know what spacing to use so that when it prints the chess board to the window, it will be fully visible without any of the previous board visible. Is there a way to do that? Right now the default size is like 25 lines in length, 50-80 lines would be optimal. Thanks to whoever knows how to do this, or if it is even possible!
I don't know if this is important, but I am using Python 2.7 and I am running Windows 7.
I believe I am using it in IDLE... I don't have anything else installed to execute .py files besides whatever came with the installation of Python 2.7.6.

Categories

Resources