Python Forum

Full Version: handling and focus in a window
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there.

I need to learn how to access window of other programs, to send data and manipulate.
below its what I need. I made the script with autohotkey:

if (chave = "1") {
WinActivate, pw3270 - 10.0.102.50 //pw is a program.

else if (chave = "2"){
Run, chrome.exe https://depositojudicial.caixa.gov.br/si...-estadual/
Sleep, 5000
Send, {enter}



I need make that in Python. I suppose that the language has some function or resource.
Please elaborate
two programs have their windows open in Windows 7, A and B.
I have a Python script, which calls user input.
what I want:
if the user types: "A", the open window of program A will receive the focus on the screen, and be in the foreground
if the user types: "B", the open window of program B will receive the focus on the screen, and be in the foreground
I can't vouch for this blog, but here's the URL, may be applicable
perhaps lift and lower: https://riptutorial.com/tkinter/example/...ift-method-