Quantcast
Channel: Raspberry Pi Forums
Browsing all 1225 articles
Browse latest View live

Python • Re: openCV moveWindow won't Move

I have a similar issue, placing multiple windows on a screen, coming from two process threads. Sometimes the windows position as intended, sometime some windows are just placed in the center. The...

View Article


Python • Unable to inherit system packages

Code: python -m venv --system-site-packages env Gives me all the system modulesCode: arandr 0.1.11asgiref 3.6.0astroid 2.14.2asttokens 2.2.1av 10.0.0Babel 2.10.3beautifulsoup4 4.11.2blinker 1.5certifi...

View Article


Python • Re: Unable to inherit system packages

Well, you never showed us if the venv is activated or not.The correct syntax is Code: # create a venv with whatever version of Python you want to use$ python -m venv env --system-site-packages#...

View Article

Python • No sound using Pygame

Hey all, long time lurker, first time poster...I am running a Rpi 3b+, with Bookworm 32bit installed. I am trying to use Pygame to play a simple MP3.Code: import pygame output_file = "Hello.mp3"try:...

View Article

Python • Re: No sound using Pygame

No mention of how you are selecting analogue audio!I found the following, tested on Bookworm 64bit with a Pi4. May need to use 'alsamixer' from a terminal window to increase volume.Basically finding...

View Article


Image may be NSFW.
Clik here to view.

Python • GraphvizFiddle.py

graphviz is a cool software for automatic layout of graphs given their descriptions only:https://graphviz.org/Years ago somebody did compile graphviz to JavaScript using emscripten.I used that to...

View Article

Python • Re: Datetime Code Not Working

TypeError: send_command() takes 1 positional argument but 3 were given. Code: send_command("Export2: Filename=/home/pi/raspberrypi/", current_time, ".mp3")Seems to me you need to turn those three...

View Article

Python • Pi Day

All,In celebration of Pi Day, I have released the following program.https://gitlab.com/JohnMarkMobley/pi.pyThe program calculates the value of pi.I wrote it in Python, and ran it on a Raspberry Pi...

View Article


Python • GPIO.wait_for_edge >>> RuntimeError: Error waiting for edge

New to this forum. Please let know if my post is in the wrog place.This code worked in an older RPi OS.I looked on this forum and couldn't find any working solutions.Here's the python as executed. Any...

View Article


Python • Re: GPIO.wait_for_edge >>> RuntimeError: Error waiting for...

Are you using a Pi5 or Pi4 or other?Statistics: Posted by neilgl — Thu Mar 14, 2024 8:44 pm

View Article

Python • DMA interrupt

Hello everyone,I am modifying the arbitrary waveform generator example on Raspberry Pico described in this link:https://www.instructables.com/Arbitrary ... ry-Pi-Pic/The program is written in...

View Article

Python • pulse counting with python

Hello thereI have in the garden a Raspberry for charging a battery with a solarpanel, the Raspberry does also measure temp, RH and airpressure and sends this to a cloud.Now I want also measure the...

View Article

Python • Re: pulse counting with python

Of course quite simple!just look what I did roughtly 10 years ago to get speed of a stationary cycle.viewtopic.php?t=119476&hilit=cycle#p812499Statistics: Posted by danjperron — Fri Mar 15, 2024...

View Article


Python • Re: Bookworm & Python library hell

Did that solve dependency in virtual environments? especially if python version is different from system (3.11) in raspberry pi.Statistics: Posted by bmadhekar — Fri Mar 15, 2024 11:14 pm

View Article

Python • Re: Pi Day

I watched this video 2 years ago, and then created this program from it. It uses also Newton–Raphson method for finding root. The Discovery That Transformed PiVeritasium...

View Article


Python • EOFError from input( )

Howdy Folks: I have a (reduced) code snippet here to keep polling user input from a process:Code: import serialport = serial.Serial( INSERT_PORT_HERE, baudrate=19200, timeout=0 )while True : try : x =...

View Article

Python • Autostart multiple python programs, each in own terminal window.

I have a raspberry pi that I only use for running two small HAM radio related programs. I want each program to start up automatically whenever power is cycled on the pi - each in their own terminal. I...

View Article


Python • Re: EOFError from input( )

If I stirp it back further to:Code: while True : try : x = input() print(x) except KeyboardInterrupt : breakIt runs fine in an interactive session but fails with that error when run in a situation...

View Article

Python • Re: Autostart multiple python programs, each in own terminal window.

In theory having two .desktop files e.g script1.desktop and script2.desktop should be fine though you may need to chnage the value in each for Name=.For alternative methods, see Running A Program At...

View Article

Python • Re: How Do I Open Audacity With Python?

Any way of making this work on start up? I tried this and it didn't work. Any way to do it? Should I change something or...Statistics: Posted by Henrik Gill — Sun Mar 17, 2024 9:38 pm

View Article
Browsing all 1225 articles
Browse latest View live