Reputation: 21
i made a simple macro using pydirectinput (pyautogui failed me so I had to go with pydirectinput ) but I can't use my computer while the script is running can I like tell python to use this macro script on a specific window/program so I can freely use the computer and the macro will do its stuff in the background?
Upvotes: 1
Views: 862
Reputation: 1329
Yes you can and it's very easy todo!
Just Rename your script's file extension to .pyw
.pyw
files are used in Windows to indicate a script needs to be run using PYTHONW.EXE
instead of PYTHON.EXE
in order to prevent a DOS console from popping up to display the output. This patch makes it possible to import such scripts, in case they're also usable as modules.
In Order to close that run file you can just open your "Windows Task Manager" using the shortcut ctrl + shift + Esc
and then find pythonw.exe
and click on DELETE
button or End Task
Button in Bottom
Upvotes: 1
Reputation: 61
If you want the script to run in the background with no window just rename the file extension to ".pyw"
To stop a script that has no window, go into task manager -> details -> locate pythonw.exe -> End Task
Upvotes: 2