'pyhton app that send key strokes to windows doesn't work after exporting it to exe file
i wrote a small program that suppose to send hardware key strokes to the computer. the code is in python. im using win automation for tasks like this but the problem is that in windows server OS the key strokes doesn't work. only in my computer everything is working fine (win 10 pro) so now im trying to use python program to do the same thing. its working on the code editor but when im trying to export the project to single exe file nothing works. even in my personal computer. at first i thought there was some problems with exporting (py-to-exe) but thats not the case here an example of a code i tried to run (exported to exe):
import time
import pyperclip
from pyautogui import press, typewrite, hotkey
time.sleep(6)
typewrite('blabla')
press('enter')
time.sleep(7)
press('enter')
time.sleep(2)
press('tab')
press('tab')
pyperclip.copy('c:\\somepath...')
filename = pyperclip.paste()
typewrite(filename)
hotkey('shift', 'tab')
press('enter')
after export i got the following error: "Traceback (most recent call last): File "main.py", line 3, in ModuleNotFoundError: No module named 'pyautogui'"
and then i tried to export a more simpler program that only moves file from folder A to folder B using shutil library and everything worked fine
can u help me solve this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
