asweigart / PyGetWindow

A simple, cross-platform module for obtaining GUI information on applications' windows.
BSD 3-Clause "New" or "Revised" License
362 stars 69 forks source link

Runs fine in terminal, but not within a script? Empty window lists always. #1

Closed unipsycho closed 5 years ago

unipsycho commented 5 years ago

Hi, I'm trying to use this library which seems great and it all works easily from the terminal with python, but if I drop that into a simple script, any get window function always returns empty data arrays.

import pygetwindow as gw
all = gw.getAllTitles()
print(all)

Paste the same three lines in a terminal, they return the window list. but in script, always returns empty. Any ideas do to fix this or what I'm doing wrong?

unipsycho commented 5 years ago

Bizzare, but I found out that some stupid antivirus containment feature was causing this. Not affecting the terminal window in the same CMD prompt, but it did affect the script running. Lame. Anyway, fixed.