首先安装PIL库,因为PIL官网没有支持python3.6的PIL库
我想在3.X中实现,因此使用pip安装pillow
pip install  pillow 
安装

安装完成后,from PIL import ImageGrab

def window_screenshoot(filename):
'''对于有弹窗的用window截图'''
path=get_path()
path_filename=path+"\\"+time.strftime('%Y-%m-%d_%H_%M_%S')+filename+'.jpg'
ImageGrab.grab().save(path_filename)  导入就可以使用了

 

相关文章:

  • 2022-02-09
  • 2021-08-01
  • 2022-12-23
  • 2021-11-23
  • 2022-02-14
  • 2022-12-23
  • 2021-08-19
猜你喜欢
  • 2021-05-25
  • 2021-09-25
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案