K
K
Kto Takoi2021-08-31 00:19:44
Python
Kto Takoi, 2021-08-31 00:19:44

Is it possible to use other programs with python code in the background?

See this situation I made a program:
import time
import pyautogui
from time import sleep
from tkinter import *
import keyboard

pyautogui.PAUSE = 2
pyautogui.FAILSAFE = True

time.sleep(5)
#pyautogui.moveTo(700, 127, duration=1)
#pyautogui.click()

i = 0
while i<10:
for a in range(601):
time.sleep(1)
print(a)
keyboard.press('enter')
pyautogui.typewrite('//' + ' /' + 'wand',interval = 0.1)
keyboard.press('enter')
keyboard.press('q')
#pyautogui.press('.')
#pyautogui.typewrite('//wand', interval=0.3)
#pyautogui.press('enter')
#pyautogui.press('q')
if a == 600:
#print("Yes!")
pyautogui.moveTo (967,574, duration=1)
pyautogui.click()
b = 10
if b == 10:
pyautogui.moveTo(700, 127, duration=1)
pyautogui.click()
#c = 0
#c += 1
#print( c)

it is used on open windows can i bind it to window 1 and make it work always in that window i.e. i work in another window and she works in another window. Or is it possible to make it work together with the program in the background?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vindicar, 2021-08-31
@Realno_cheal

pyautogui doesn't seem to be able to do that. Look towards pywinauto.

D
dmshar, 2021-08-31
@dmshar

1. Arrange your code in tags so that you can understand what your program is doing.
2. Write your question using the grammar of the Russian language so that you can understand what exactly your question is.
3. Try to explain what " use other programs with python code" means in common terminology.
4. " It is used on open windows " - who is IT and on what WINDOWS (plural)?
5. that is, I type work in another window, and she works in another window - i.e. you launched the program in one window, but switched to another? - Yes, it is possible. (This seems to be the answer to your question)
6. Or is it possible to make it work together with the program in the background? - who is SHE, together with what program? What does "together" mean? In the background, you can run any program that does not conduct a dialogue with the user (that's why it is in the background). Moreover, such programs can be re-launched as much as the resources of your computer allow.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question