Python • Re: breaking my code into separate files
Using separate files to group functions and classes in a logical way is always good - and keeps source files a manageable size for future enhancement. I try to keep files under 1000 lines max, usually...
View ArticlePython • Re: Using tkinter with two monitors
Use the screen configuration utility to position the two monitors side by side The two windows are creaated as Tk and Toplevel tk_window0=Tk() tk_window1=Toplevel()Then use tk_window0/1.geometry() to...
View ArticlePython • Re: installing RPi.GPIO and vs code issues
I used the following command in a .ipynd file: %pip install RPi.GPIO. When I ran import RPi.GPIO in the notebook it runs perfectly. However, when I ran the same command in a .py file I...
View ArticlePython • Matplotlib - Axes values
I have imported matplotlib, within Tkinter and am using it successfully to display temperatures from a DS18B20 sensor.However, the x axis always contains dates starting at 2022-01 in 6 monthly...
View ArticlePython • Re: Matplotlib - Axes values
excuse me, but what is the unpleasant codeStatistics: Posted by dbrion1 — Fri Dec 15, 2023 10:32 am
View ArticlePython • PiCamera2 Library in Conda Environment
I'm using RoboStack to handle installation of ROS for robotics development, it uses Conda for virtual environments and it seems there's no option to use the venv option of `--system-site-packages` to...
View ArticlePython • Re: PiCamera2 Library in Conda Environment
Conda operates under the concept of everything must be installed in the venv, and it does not have an option to use any packages installed in the system's managed Python distribution. In other words,...
View ArticlePython • gpio.setup() on raspberry pi5
hi,i try to use mfrc522 library (NFC library) on my raspberry pi 5 but the code not work becouse the library use RPI.GPIO. How can i solve this error.i know that raspberry pi5 not support RPI.GPIO but...
View ArticlePython • Re: gpio.setup() on raspberry pi5
Deleted wrong informationStatistics: Posted by neilgl — Sun Dec 17, 2023 10:13 pm
View ArticlePython • Python script won't run on reboot using crontab (Raspberry Pi 4)
I'm very new to coding, so please excuse any obvious beginner's mistakes. I'm trying to make a Raspberry Pi 4 (running Bullseye) continuously listen for any noise over a certain volume using a USB...
View ArticlePython • Re: Python script won't run on reboot using crontab (Raspberry Pi 4)
The guide to (almost) everything related to startup is here : viewtopic.php?t=314455Statistics: Posted by neilgl — Mon Dec 18, 2023 5:43 pm
View ArticlePython • openCV moveWindow won't Move
I have two USB Webcams connected to a Raspberry Pi4 . Running the following script I get two videos on the monitor as intended.Code: import cv2cam0 = cv2.VideoCapture(0)cam1 =...
View ArticlePython • Re: openCV moveWindow won't Move
redundant with following < deletedStatistics: Posted by dbrion1 — Tue Dec 19, 2023 4:11 pm
View ArticlePython • RPi.GPIO on Pi5
wrote a python program on pi4, it runs smoothly. When I run the same program on pi5 I get a error on line 17 which is : PIO.setup(button_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) the error is: Traceback...
View ArticlePython • Pylance: can import csv, but NOT sys OR os modules ... WTHey?
Totally new to Python, a bit lost in the plethora of run-time environments... using .venv inside vscode,and to read/write csv data from/to files, the line: import csv works fine...Now I want to read...
View ArticlePython • Re: Pylance: can import csv, but NOT sys OR os modules ... WTHey?
The .vscode folder is only created if you make changes to settings in your projects work space or do there things like create a debug launcher or the like.The squiggly line is because vscode cant find...
View ArticlePython • Re: RPi.GPIO on Pi5
gpiozero and gpiod also don't workStatistics: Posted by Ockwig — Wed Dec 20, 2023 3:23 am
View ArticlePython • Re: Make python script run on boot
Here:[Unit]Description=Livestream[Service]ExecStart=/usr/bin/python3 /home/SDAirport/livestream.pyRestart=alwaysUser=root[Install]WantedBy=multi-user.targetStatistics: Posted by TheDangerZone — Wed...
View ArticlePython • Re: GIPOzero perform an action if the button hasn't been pressed...
Have you looked at the "when_pressed" and "when_released" functions?Statistics: Posted by neilgl — Thu Dec 21, 2023 4:13 pm
View ArticlePython • HC-SR04 ultrasonic sensor
Hello, I am a total newbie to rpi and python and I would like to use HC-SR04 ultrasonic sensor in my project. I understand how the sensor works, but cannot make it work properly. I want to have...
View Article