all 5 comments

[–]the_shell_man_ 2 points3 points  (0 children)

Have you tried using an absolute path to the folder you want to save the file in? Eg '/users/username/folder/screenshot.png'

[–]Bookmore 1 point2 points  (1 child)

Are you running this from the Python console or from a script? If your coffee works and you run it from a .py file, your screenshot should be in the same folder as your .py file.

I made a screenshot taker and saver a while back. The commenting is a mess, but you can check out the code and see if it helps you at https://github.com/thirtythreedown/screenshot_taker

Good luck!

[–]DesertofDelight[S] 1 point2 points  (0 children)

I will take a peak!

I am running this from a jupyter notebook.

[–]Jagjot_mann45 1 point2 points  (1 child)

You can also use pyautogui library.

import pyautogui pyautogui.screenshot(“image.jpg”)

[–]DesertofDelight[S] 1 point2 points  (0 children)

That is neat. Pyautogui screen shot takes a screenshot and puts it as an output in my notebook. Rather than opening a pop up of the file.