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.5k stars 1.27k forks source link

trying to use it in the text editor #853

Open DevYuriOliveira73 opened 7 months ago

DevYuriOliveira73 commented 7 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 7 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 7 months ago

Thank you, I will test.