Advertisement
steve-shambles-2109

Python- Get screen resolution

Mar 24th, 2020
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. """Code snippets vol-46-snippet-229
  2.   Get screen resolution
  3.   Windows only.
  4.  
  5. Download all snippets so far:
  6. https://wp.me/Pa5TU8-1yg
  7.  
  8. Blog: stevepython.wordpress.com
  9.  
  10. Requirements:pip3 install pywin32
  11.  
  12. Source:
  13. http://timgolden.me.uk/python/win32_how_do_i/find-the-screen-resolution.html
  14. """
  15. from win32api import GetSystemMetrics
  16.  
  17. width = GetSystemMetrics(0)
  18. height = GetSystemMetrics(1)
  19.  
  20. print("Screen resolution = %dx%d" % (width, height))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement