forked from amark720/Python_Projects
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenShot_App.py
More file actions
Latest commit
32 lines (23 loc) · 636 Bytes
/
Copy pathScreenShot_App.py
File metadata and controls
32 lines (23 loc) · 636 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
32
importtime
importpyautogui
importtkinterastk
defscreenshot():
name=int(round(time.time() *1000))
name='C:/Users/gsc-30431/PycharmProjects/test1.py/Screenshot_App/{}.png'.format(name)
# Update the Directory path above where the screenshots will be saved.
img=pyautogui.screenshot(name)
img.show()
root=tk.Tk()
frame=tk.Frame(root)
frame.pack()
button=tk.Button(
frame,
text="Take Screenshot",
command=screenshot)
button.pack(side=tk.LEFT)
close=tk.Button(
frame,
text="Quit",
command=quit)
close.pack(side=tk.LEFT)
root.mainloop()