Skip to content

Instantly share code, notes, and snippets.

@graz68a
Created February 6, 2020 09:50
Show Gist options
  • Save graz68a/0497b0a866406892f3dd4449d9d25ef0 to your computer and use it in GitHub Desktop.
Save graz68a/0497b0a866406892f3dd4449d9d25ef0 to your computer and use it in GitHub Desktop.
import mss
import mss.tools
import datetime
import time
import pysftp as sftp
count = 0
while count < 100000000:
with mss.mss() as sct:
monitor = sct.monitors[1]
timestr = time.strftime("%Y%m%d-%H%M%S")
sct.compression_level = -1
output = "d:/screen/work/" + (timestr) + ".png".format(**monitor)
sct_img = sct.grab(monitor)
mss.tools.to_png(sct_img.rgb, sct_img.size, output=output)
print(output)
try:
s = sftp.Connection(host='127.0.0.1', username='admin', password='*****')
local_path = "" +(output)+ ""
remote_path = ""
s.put(local_path, remote_path)
s.close()
except Exception as e:
time.sleep(10)
count += 1
@graz68a
Copy link
Author

graz68a commented Feb 6, 2020

import mss
import mss.tools
import datetime
import time
import pysftp as sftp

count = 0
while count < 100000000:
with mss.mss() as sct:
monitor = sct.monitors[1]
timestr = time.strftime("%Y%m%d-%H%M%S")
sct.compression_level = -1
output = "d:/screen/work/" + (timestr) + ".png".format(**monitor)
sct_img = sct.grab(monitor)
mss.tools.to_png(sct_img.rgb, sct_img.size, output=output)
print(output)
try:
s = sftp.Connection(host='127.0.0.1', username='admin', password='monteamiata19')
local_path = "" +(output)+ ""
remote_path = ""
s.put(local_path, remote_path)
s.close()
except Exception as e:

time.sleep(10)
count += 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment