asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.06k stars 1.22k forks source link

trying to use it in the text editor #853

Open DevYuriOliveira73 opened 4 months ago

DevYuriOliveira73 commented 4 months ago

I wanted to know if this library works in specific environments. For example using this code:

=======================================

import pyautogui
import time

time.sleep(2)

pyautogui.write('UFC Combate', interval= 0.15)
pyautogui.press('enter')

=======================================

The code works in the IDE or browser, however it does not work in the UBUNTO text editor

darkb0ts commented 3 months ago

may be text editor may not allow external programs to simulate keyboard input or Ubuntu text editor doesn't have focus when the script is running

Run the script with administrative privileges to see if it's a permissions issue. [ chmod +x filename ]

DevYuriOliveira73 commented 3 months ago

Thank you, I will test.