Created
February 6, 2020 09:50
-
-
Save graz68a/0497b0a866406892f3dd4449d9d25ef0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: