A dead simple Python script to capture screenshots. Written mostly for demonstration purposes. Dependencies:
How this program was built (Russian): https://www.youtube.com/watch?v=rJe_osIzqUY
Install the above dependencies manually or use Poetry to do the job for you:
poetry install
Run:
python python_screenshots/screenshots.py
Or with Poetry:
poetry run python python_screenshots\screenshots.py
Keep the window opened (it does not have to stay in focus) and press the PrtScr
key to make a PNG screenshot. By default, screenshots are created in the same directory where your script resides, under the screens
subdirectory.
To provide a custom subdirectory:
python python_screenshots/screenshots.py my/sub_dir
Stop the script with Ctrl+Shift+X
.
To build an executable file you can use pyinstaller
:
poetry run pyinstaller python_screenshots/screenshots.py -F
Install Poetry and run:
poetry install
Have fun.
(c) Ilya Bodrov-Krukowski, licensed under the beer-ware license.