Repository navigation
PyShot 2.0.0
Press Ctrl+Shift+H anywhere: the screen freezes and dims, you drag a region (or click a window), and you get a lossless PNG on your Desktop and on the clipboard. One Python file, fully offline, no telemetry, no global keyboard hook.
New
- Capture follows the mouse. The overlay opens on the monitor you are actually working on, not always the primary one —
CAPTURE_TARGET = "cursor" | "primary" | "all". - Click a window to capture it, at its true DWM frame: no border slivers, no drop shadow.
- Magnifier with crosshair guides and a live
x,y #rrggbbreadout.Ccopies that colour instead of taking a shot. - Your hotkey actually rebinds.
HOTKEY_CAPTURE = "printscreen"(or"ctrl+alt+f9","ctrl+shift+f12", …) now works; previously those constants were labels that did nothing and the real binding was a hex virtual-key code. CAPTURE_MODEpicks the sinks:both,clipboard(nothing accumulates on your Desktop), orfile.- The toast is clickable — open the shot, or right-click to reveal it in Explorer — and it honours the taskbar's real work area on any edge.
- Failures are visible. A missing dependency, a hotkey another app already owns, and a second launch each say so on screen instead of failing silently under
pythonw. - Tests and CI.
pytestcovers the pure logic (crop math, filename sequencing, theCF_DIBheader, hotkey parsing), CI runs onwindows-latest, plusrequirements.txt, a pinnedruffconfig, andpyshot.specfor a single-filePyShot.exe.
Fixed
- A save error no longer throws the capture away — the clipboard write needs no filesystem, so a read-only, full or offline OneDrive
Screenshotsfolder can't cost you the shot. - A replaced toast no longer leaves an armed timer behind, which surfaced as a modal Tcl error dialog in a tool whose whole premise is being silent. The selection renderer had the same latent flaw.
- Alt+F4 on the overlay no longer wedges PyShot into ignoring every later hotkey, and nothing escaping the event loop can stop it re-arming.
- The desktop and taskbar are excluded from window snapping, so a click on empty space cancels instead of saving a full-screen PNG.
Escregistration,--startupreporting,explorer /selecton paths containing spaces, and the startup shortcut's self-repair all behave as documented.
Changed
- The capture target defaults to the monitor under the cursor rather than always the primary one.
- A click without a drag grabs the window under it; previously it always cancelled.
--debugis now--startup(the old name still works),--helpexists, and an unknown option is reported instead of silently starting an invisible background copy.
Install
pip install -r requirements.txt
pythonw pyshot.py # runs in the background, no console window
python pyshot.py --startup # add to / remove from Windows startupNo Python? Build a single self-contained executable:
pip install pyinstaller
pyinstaller pyshot.spec # → dist\PyShot.exeRequires Windows 8.1+ (best on Windows 10 1703+) and Python 3.9+.