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

Window.__str__ broken, cant print window #28

Open laundmo opened 4 years ago

laundmo commented 4 years ago
Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
  File "<stdin>", line 11, in sortwindowlocation
  File "c:\python38\lib\site-packages\pygetwindow\__init__.py", line 71, in __str__
    r = self._getWindowRect(self._hWnd)
TypeError: _getWindowRect() takes 1 positional argument but 2 were given
ealmloff commented 4 years ago

looking around the source code it looks like this is easily fixed by removing self._hWnd: https://github.com/asweigart/PyGetWindow/pull/33