Trying to find an example of how to capture screen to file via python?
Trying to find an example of how to capture screen to file via python? As a way to figure out why openCV and modules pyautoGUI fail on Pi OS. Tried several methods of trying to capture the desktop and then search that capture for a given 'png' file match in said screen capture. Each example fails stated it does not have authority to read display:0. Really suck, any help appreciated.
Re: Trying to find an example of how to capture screen to file via python?
try...
import os
os.system("grim test.png")
import os
os.system("grim test.png")
Re: Trying to find an example of how to capture screen to file via python?
Are you trying to do this remotely? That adds at least one layer of complication.
Gordon's method works, at least for local access.
‘Remember the Golden Rule of Selling: "Do not resort to violence."’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
Re: Trying to find an example of how to capture screen to file via python?
in the console type in
man scrot
man scrot
Re: Trying to find an example of how to capture screen to file via python?
'scrot' runs, but does not work with recent OS using 'wayland'. Produces just plain black images. 'grim' works with 'wayland'.
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion