Python • Re: oled noob stuff
I never used those displays, so can't help you with that.Chatgpt sucks for these things, I would not bother with it.Statistics: Posted by memjr — Sun Oct 06, 2024 7:07 pm
View ArticlePython • Re: Python Script keeps Exporting after Finally Statement
An explict return is AFAIK only required in two circumstances:You want to exit the function early:You want to return some specific data to the caller.Or for proper concise coding standards.For your...
View ArticlePython • Educational videos?
Just getting my feet wet working with python and coding in general and wondering if there by chase a good source of videos on python? I'm more of a visual learner so being able to see how it's done is...
View ArticlePython • Re: Educational videos?
YouTube is full of videos in the subject. Go there and search for "pi python".Pay attention to how old/new a video is. A lot of the old stuff has changed and won't work well, if at all in a new pi...
View ArticlePython • fails to read localhost over TCP from python, but comd netcat works
dumb question but I'm really stuck...I can read localhost (ebusd) from shell with netcat command:user@raspberrypi:~ $ echo r -c 700 AdaptHeatCurve | nc -q 1 127.0.0.1 8888noThe response received "no"...
View ArticlePython • Re: fails to read localhost over TCP from python, but comd netcat works
You need to bind the socket to an ip/port.Code: STREAM_IP = ""STREAM_PORT = 5005sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)try: sock.bind((STREAM_IP, STREAM_PORT))except: print("bind...
View ArticlePython • Re: (edited) Weather display
It's me again....Been up all night reading up and researching on Python and kind of sloppily came up with a code for other codes here and there. I'm positive it won't work so before I even attempt it...
View ArticlePython • Send email from python
I have a python script that fetches emails for /var/mail/pi and run a function called send_email() witch was generated by bing copilotnow Microsoft Outlook needs 2FA this does not workanyone know of a...
View ArticlePython • Re: Send email from python
With Gmail you can create App-Passwords and use them. I guess Microsoft has a similar solution.Translated from German: Create app passwords for apps and devices (such as Xbox 360, Windows Phone 8 [or...
View ArticlePython • PID controller help
Complete newbie here but ive got the bones of my system figured out I think, I just need help on the PID setupI’m using a temperature input to control a pwm output, which I’ve got set up and working...
View ArticlePython • Re: PID controller help
I've used PID controllers, but not with Python. I use it with xml in the FlightGear simulator. It's how the autopilots work.You didn't provide enough info to determine what you need. What is it about...
View ArticlePython • Help installing libraries
Hello all, I am trying to install blinka for the bmp390 altimeter on a raspberry pi 2 zerow and I get the following message.$ sudo pip3 install adafruit-circuitpython-bmp3xxerror:...
View ArticlePython • Re: Help installing libraries
Carefully read the message. It gives you 2 different ways to make it work, including a link for the "correct" way going forward with Bookworm and newer OS and then how to make it work as it used to...
View ArticlePython • Libraries absent in Virtual environment
So I have a simple code Code: import gpiozerorelay=gpiozero.OutputDevice(17)When I run this outside of the virtual environment it works fine. When I run it inside the virtual environment I get the...
View ArticlePython • Re: Libraries absent in Virtual environment
Did you remember to use the --system-site-packages o[tion when you created the venv?Statistics: Posted by thagrol — Fri Oct 11, 2024 3:58 pm
View ArticlePython • Auto start
Hi,I try to start a python code using a picamera.I've tested sevral methods (/etc/xdg/lxsession/LXDE-pi/autostart ; etc....) and using crontab but nothing works.I do not use virtual environement. I've...
View ArticlePython • Re: Auto start
What OS and Pi are you using and which version of pygame?On 4B, 400, and Pi5 with 2GB of RAM or more running RPiOS Bookworm the default desktop is wayland/wayfire so the X related startup methods...
View ArticlePython • Re: Python Script keeps Exporting after Finally Statement
The Code:Code: import pyaudioimport timeimport waveimport RPi.GPIO as GPIOfrom datetime import datetimerg = False# ConfigurationBUTTON_PIN = 27 # GPIO pin number for the buttonBUTTON_PIN_TWO = 17 #...
View ArticlePython • Re: Send email from python
I see now. Outlook requires 2 Factor Authentication. Usually sent by text message or email. Correct?I'm not sure where in the auth protocol you would enter that.you are correctI can't be done by text...
View ArticlePython • Output to .csv file in Chinese? Characters
I have a Python3 program that outputs data daily to a .csv file. This data is just numbers, usually between 10000 and 30000.I don't read the data very often but having tried to read it today, instead...
View Article