Capture your screen shorts with python


SUBMITTED BY: Charity

DATE: May 11, 2020, 10:17 p.m.

FORMAT: Text only

SIZE: 264 Bytes

HITS: 489

  1. # visit pyGuru on YouTube
  2. # pip install pillow
  3. # pip install keyboard
  4. from PIL import ImageGrab
  5. import keyboard
  6. def screenShot():
  7. sc = ImageGrab.grab()
  8. sc.save('screenshot.png')
  9. while True:
  10. if keyboard.is_pressed('p'):
  11. screenShot()
  12. break

comments powered by Disqus