I am creating a beta tester reporting module so that they can send their comments to their software, but with a report I Option to include screenshots How can I get a screenshot of the screen with Python on Windows? I have found many examples on Linux but have not found much luck on Windows.
It is worth noting that ImageGrab only works on MSWindows.
For cross-platform compatibility, one person may be best with using the WxPython library
import wx wx.App () # by doing anything First need to create an app instance = wx.ScreenDC () size = screen.GetSize () bmp = wx.EmptyBitmap (size [0], size [1]) mem = wx.MemoryDC (bmp) mem.Blit (0 , 0, size [0], size [1], screen, 0, 0) del-mem # release bitmap BMP. SaveFile ('screenshot .png', wx.BITMAP_TYPE_PNG)
Comments
Post a Comment