Python • Re: Filemanager crashes after running Python script.
Just to give an update on this incase anyone else has a similar issue, I was able to reslove it by making a change in the Pi's config file setting it to display at 4k. I am unsure why I had to make...
View ArticlePython • Errors with p5 and Target Practice Tutorial
Hello, I am attempting to do the python tutorials. I have tried using the online code editor and my raspberrypi 4 B with Thonny. I just fired up my pi for the first time yesterday with basic raspbian...
View ArticlePython • Re: Errors with p5 and Target Practice Tutorial
Can you post a link to this tutorial?Statistics: Posted by neilgl — Wed Aug 21, 2024 9:43 pm
View ArticlePython • Re: Raspberry pi 5 with DHT11
Hi, I tried your solution and it works sometimes. In the beginning it works fine but then there are no anwsers anymore. Do you know a solution for this?Statistics: Posted by anton__ — Thu Aug 22, 2024...
View ArticlePython • Re: Getting more out of the CPU when running python project
Python threads do not run in parallel. To get more stuff to run in parallel you'll need to run stuff in different processes. That way you can get 1 process running per core and if need be, you can...
View ArticlePython • BLE connection Raspi 4 to Polar H10 chest belt via Python-script
Hi,I'm trying what I would consider to be a simple task but I don't succeed so far. The only thing I want to do is to connect a sensor via Bluetooth to the Raspberry 4B and read out it's data. In my...
View ArticlePython • Re: BLE connection Raspi 4 to Polar H10 chest belt via Python-script
You need to replace xx:xx.. with the address of the LE device. For example:Code: device_mac = "12:34:56:78:9A:BC"Statistics: Posted by petzval — Sun Aug 25, 2024 12:16 pm
View ArticlePython • Re: Button to restart Pi, button to restart program
For restarting the script, you could try something like this:Code: from gpiozero import Buttonimport subprocessfrom signal import pauseimport sysdef restart_program(): try: subprocess.run(['python',...
View ArticlePython • AttributeError: 'App' object has no attribute 'button' tkinter and...
Hello All, I'm new to python and programming in general, I'm trying to create a GUI that changes between frames when I press a physical button on my raspberry pi, but I'm getting the error of App...
View ArticlePython • Re: AttributeError: 'App' object has no attribute 'button' tkinter...
I don't know tkinter but your line 'self.button.when_pressed = self.make_page_1' is trying to combine tkinter with GPIOZERO code. That is why you are getting the error. Python is looking for a...
View ArticlePython • Which Python IDE for RPI 5 and RPI OS
Which Python IDE for RPI 5 and RPI OS. Need break point, single stepping, examinate/change variable. Is PyCharm the best? We had used PyCharm and Thonny for MicroPython Pico some time ago on Windows...
View ArticlePython • Re: Which Python IDE for RPI 5 and RPI OS
I switched all my Python projects from PyCharm to VS Code.VS Code is rapidly becoming the only coding IDE I use on any platform for any programming language.Statistics: Posted by Paul Hutch — Mon Aug...
View ArticlePython • OpenCV and Libcamera
I have a script that worked great on buster with my Rpi HQ cam. https://github.com/ThorstenSchumacher/SpecControlNow I tried to run it on bullseye but I have an issue as OpenCV cannot access libcamera...
View ArticlePython • Re: OpenCV and Libcamera
you refactor using libcamera / picamera2; sorry. It's a bit of a pain, but you're going to have to do it sooner or laterStatistics: Posted by scruss — Tue Aug 27, 2024 1:40 am
View ArticlePython • Problems using PWM in subprocess
HeyI've been having some problems running PWM in subprocesses. Just had another post here on this forum that kind of leads into this one.So I started to experiment with switching my project from using...
View ArticlePython • Running script with pygame headless
Hi! First time asking a question.I made a python script that is intended to be run headless, without a monitor. However, the script doesn't run when pi is not connected to the screen. While I was...
View ArticlePython • Re: Running script with pygame headless
Depending on what the script does, you could replace pygame with something else to read key presses e.g. pip install keyboard, then use:Code: keyboard.on_press(key_press) etc.Statistics: Posted by...
View ArticlePython • +/- Value
Hi, I'm trying to add add a +/-1 dead band to a value so the output doesn't chatter with noise. Any help would be greatly appreciated. Thankspotvalue == (+/-1)+15:current working codeCode: #15 Deg if...
View ArticlePython • Re: +/- Value
Hi, I'm trying to add add a +/-1 dead band to a value so the output doesn't chatter with noise. Any help would be greatly appreciated. Thankspotvalue == (+/-1)+15:current working codeCode: #15 Deg if...
View ArticlePython • Re: UDP sendto blocks code execution when the interface is down
I'm not certain if this will solve it, but you could try adding the MSG_DONTWAIT flag. See the send(2) manpage for details.Code: sock.sendto(bytes, socket.MSG_DONTWAIT, address)N.B. the underlying...
View Article