Created
February 6, 2020 09:58
-
-
Save graz68a/f5bdfcd70b131bfccfba1c5ee294255f to your computer and use it in GitHub Desktop.
This file contains hidden or 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='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