how to use python to take screenshot

Solutions on MaxInterview for how to use python to take screenshot by the best coders in the world

showing results for - "how to use python to take screenshot"
Federica
23 Jun 2020
1please check out my video also - https://www.youtube.com/watch?v=7Tr0mEQhc3M&t=2s
2please subscribe my channel - https://bit.ly/2Me2CfB
3
4# importing the ImageGrab function from PILLOW (PIL) Module
5from PIL import ImageGrab
6
7# to take the screenshot of your pc (Main Function)
8screenshot = ImageGrab.grab()
9
10# saving the screenshot in your pc (screenshot will be saved in the directory you are working)
11screenshot.save()
12
13# To open the screenshot in the default image viewer (Optional)
14screenshot.show()
Vianney
18 Apr 2018
1import pyautogui
2import tkinter as tk
3import time
4root= tk.Tk()
5
6canvas1 = tk.Canvas(root, width = 300, height = 300)
7
8canvas1.pack()
9
10def takeScreenshot ():
11    current_time = time.time()
12    myScreenshot = pyautogui.screenshot()
13    myScreenshot.save(r'D:\videos\Mannuly\Taken'+str(current_time)+".png")
14
15myButton = tk.Button(text='Take Screenshot', command=takeScreenshot, bg='green',fg='white',font= 10)
16canvas1.create_window(150, 150, window=myButton)
17
18root.mainloop()
queries leading to this page
save screenshot pythonscreenshot using pythonhow to take a screen shot in python by imagegrabhow to take screenshots in pythontake screenshot of display pythonhow to take a screenshot python and processi ttake a screenshot with pythonhow to take screenshot of a window in with pythonscreen shot pyhtontake a screenshot pythonscreenshot monitor pythonget screenshot in pythonpython website screenshottake snapshot with pythontake screenshot in pythontake screenshot with pythonhow to take screenshot of device using pythonhow to screenshot in pythonfastest way to take a screenshot with python on windowshow to let python take screenshotpython screenshot windowhow to dump screenshot with pythonhow to take a screenshot with pythonpython how to take a screenshothow to take screenshot pythonpython capture screenshotpython program that can take screenshot of screenpython screenshot libraryhow to take screenshot using pythonpython html screenshotcode to take screenshot in pythonscreenshot python documenthow to take screenshot with python on websitepython screenshotpython program that screenshots the screenpython code for taking screenshottake a screenshot using pythonhtml create screenshot pythoncapture screen shot pythonpython image screenshotget a screenshot pythonpython3 take a screenshottake screenshot of window pythonhow to take screenshot in pythonscreenshot in url pythontake screenshot using pythonpython screenshot screenpython take a screenshothow do i take a screenshot with pyhtonscreenshot pythontaking screenshot of screen pythonpython take screenshottake screenshot of program pythonpython take a screen shotpython get screenshot in windowpython make screenshothow to get screenshot with pythonhow to take screenshot from specific using pythonhow to take screenshot with pythonmake screenshot with pythontaking screenshots with pythonhow to take screenshot of screen pythonhow to use python to take screenshothow to take a screenshot on pythonhow to identify a screenshot pythonpython script to take screenshot of serpspython take screenshot of windowtake a screenshot of a website pythonget a full screenshot of python codeget screenshot pythonpython how to capture windows screenshothow to take screenshot of a window with pythonhow to screenshot using pythonhow to take a screenshot pythonpython screenshot computertaken screenshot of window in pythontake a screenshot of window on pythonpython page screenshothow do you take a screenshot of a whole page in python 3fscreen shot in pythonhow to take a screen shot using pythonscreenshot objects in pythonhow to take a screenshot using pythonscreenshot desktop pythontake screenshot pythonscreenshot program in pythoncreate screenshot using pythonscreenshot in pythonpy take screenshotscript to take screenshot automatically pythonhow to screenshot with pythonhow to take a screenshot of a page using pythonhow to take a screenshot in pythonpython take a screenshot windowspython get screenshotpython library to take screenshothow to use python to take screenshot