简体   繁体   English

ImageGrab.grab() 在第一个屏幕上运行代码时的第二个屏幕

[英]ImageGrab.grab() the second screen while running code on the first screen

As the question says.正如问题所说。 Can I screenshot the second screen when my script is running on the first screen?当我的脚本在第一个屏幕上运行时,我可以截取第二个屏幕吗? I mean I have the code running on my first screen and I want to capture the second screen only.我的意思是我的代码在我的第一个屏幕上运行,我只想捕获第二个屏幕。 How do I do it?我该怎么做? Of course all done with ImageGrab.grab() from PIL module.当然,所有这些都是通过PIL模块中的ImageGrab.grab()完成的。

Question solved!问题解决了!

PIL.ImageGrab.grab(bbox=None, include_layered_windows=False, all_screens=True)

And it captures every screen.它捕获每个屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM