Screenshot of a window using python

后端 未结 4 2175
清酒与你
清酒与你 2020-12-03 08:47

I\'m trying to take a screenshot of the curent window using a python script on linux.

I curently have a script which takes a screenshot of the entire screen:

4条回答
  •  北海茫月
    2020-12-03 09:30

    Alternatively, instead of

    p = QPixmap.grabWindow(widget.winId())
    

    you can also use

    p = QPixmap.grabWidget(widget)
    

提交回复
热议问题