Advertisement
Guest User

Untitled

a guest
Mar 5th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def renew(self):
  2. ps = subprocess.Popen('xwd -root -display virgl-host:0'.split(), stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
  3. output = subprocess.check_output(('xwdtopnm'), stdin=ps.stdout, stderr=subprocess.DEVNULL)
  4. ps.wait()
  5.  
  6. f = io.BytesIO()
  7. f.write(output)
  8. f.seek(0)
  9. self.old = self.new
  10. img = Image.open(f)
  11. self.new = np.asarray(img)
  12. img.close()
  13. f.close()
  14. return()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement