forked from SpielerNogard/geschenkebot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen_maker.py
More file actions
executable file
·31 lines (25 loc) · 818 Bytes
/
screen_maker.py
File metadata and controls
executable file
·31 lines (25 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import subprocess
import time
from datetime import datetime
from shutil import copyfile
class screen_maker(object):
def __init__(self):
self.log("screen_maker ready")
def log(self,info):
now = datetime.now().time()
now = str(now)
print(now+" : "+info)
def make_screen(self):
now = datetime.now().time()
now = str(now)
self.log("Mache Screenshot")
subprocess.call("adb exec-out screencap -p > Bilder/screen.jpg",shell=True)
now = now.replace(":","_")
now = now.replace(".","_")
copyfile("Bilder/screen.jpg","Bilder/"+str(now)+".jpg")
self.log("Screenshot Saved")
def run(self):
while True:
self.make_screen()
#BOBB = screen_maker()
#BOBB.run()