Created
February 6, 2020 10:09
-
-
Save graz68a/39a0411a2bdedcd2c971d7c0ece82204 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="********") | |
local_path = "" + (output) + "" | |
remote_path = "" | |
s.put(local_path, remote_path) | |
s.close() | |
except: | |
print("Couldn't connect to ftp") | |
return False | |
time.sleep(10) | |
count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment