Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [python]

Python is a general-purpose, dynamically typed, object-oriented high-level programming language. Interpreters for versions 3.x and 2.x come installed on the Raspberry Pi's most popular operating system distributions.

654 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
46 views

The Python Games that come with NOOBS extend off screen

Most (all?) Python games that come with NOOBS (Pentamino, GemGem etc) extend off the bottom of my Raspberry Pi 7-inch touch screen. I can successfully play some of them by right clicking the TLH ...
1
vote
2answers
530 views

mq5 gas sensor not alerting of leakages

I'm currently using an mq5 gas sensor in my kitchen with the MCP3208 ADC. my code shows a continuous loop of the voltage charge. in the mq5 as it detects gases in the air. It is supposed to print ("...
1
vote
0answers
76 views

PuTTY network error when running Python scripts on a Raspberry Pi

I run Python scripts on my Raspberry Pi from my Android device and it always works for 3 or 4 times, but when I do it more, PuTTY tells me the following: Network error: Software caused connection ...
1
vote
0answers
218 views

Cursor doesn't respond to touch in pyqt5 program

I am very new to both programming in python and touch interface stuff on the Pi. I have run into an issue I can't seem to resolve by googling: I have a Sainsmart 7" touch screen that works perfectly ...
1
vote
1answer
4k views

Error trying to install python-firebase on Raspberry Pi 3

I have installed requests but I'm unable to install the python-firebase package. I want to fetch data from firebase on my Raspberry Pi 3. I have used the following code to do the same on my PC. from ...
1
vote
1answer
299 views

Installing Jasper runs on several errors

I'm trying to install Jasper with this guide. Now i'm hanging with the following problem: i try to use the command sudo apt-get -t experimental install phonetisaurus m2m-aligner mitlm libfst-tools, ...
1
vote
1answer
252 views

Asterisk and Python communicate in Raspberry Pi?

I'm currently working on a project which is based on RPi and Asterisk. What I Want In my project, I need to get incoming call details like caller ID into python and perform some functions connected ...
1
vote
0answers
182 views

Scientific Python 3 Updates

I want to use python 3 with the many scientific updates (numpy, etc.) on my new Raspberry Pi 3 (with latest Raspian). I followed some excellent advice from: Scientific Python for Raspberry Pi ...
1
vote
0answers
2k views

Raspberry Pi, Python and snmp traps, tripping a light when a network drop disconnects

I've got a fun little problem that I have hacked together a solution for, but I'm thinking there's probably a more elegant way of going about it. (I also had one heck of a time googling any ...
1
vote
0answers
551 views

Raspberry Pi 3 16x2 LCD display issue

I am trying to run code to output to my 16x2 display, but when I try to run the python file, there is no visible output to the display, and the following is returned: "/usr/local/lib/python2.7/dist-...
1
vote
1answer
3k views

Execute python script with web server apache2

I have a problem, I can't execute a Python script on my Raspberry Pi 3. I set an Apache server to execute a python script by following a tutorial. I can execute the following script: #!/usr/bin/...
1
vote
0answers
263 views

subprocess stdout into a variable for Ngrok

I'm trying to make a python script wich reports me the port on 0.tcp.ngrok.io is started when I run the code on terminal (after moving ngrok executable file to /usr/local/bin) ngrok tcp 22 I get ths ...
1
vote
0answers
154 views

Python Google drive upload not working continuously

I am trying to build an auto image Google drive up-loader with raspberry pi and a web-cam but the python script I wrote after executing once properly doesn't seem to work if I execute it again ...
1
vote
1answer
92 views

Cannot Load Library “./pxcore.so” to autorun a python script on boot using systemd

I want to run a code at startup but I am getting this error below. The script works when running in python, but I am unsure how to allocate permissions or where to make a path to the pxcore.so file so ...
1
vote
0answers
577 views

Remote python debugging with Visual Studio Code from Mac

I am trying to remote debug from Visual Studio Code on Mac OS. I would like to know if anyone has managed this or if it only possible from Visual Studio for Windows, or if not, what am I doing wrong? ...
1
vote
1answer
1k views

Problem with GPS module and Python

I copied a program from the Adafruit webpage to test my GPS module and before running it I installed the Python gps with sudo apt-get install python-gps but when I run the program I get this error: ...
1
vote
0answers
966 views

Problems communicating with USB to Serial CP210x Rs-485 serial device not responding

I have a hardware setup with one lock controller Made in China, I have setted up everything as it was supposed to, trying to communicate with the device with Python Script, lsusb show me the device ...
1
vote
0answers
151 views

Trouble with sound detection

I am trying to see how long it takes pygame.mixer.music.play() to actually initialize a sound. I have an audio cord running out the 3.5 jack back into the Pi through a USB soundcard. I think the code ...
1
vote
0answers
86 views

Opening and closing of gate based on value returned by a function in Python

I was writing a piece of code to open/close a gate, based on the value returned by a function. The gate is linked to an Arduino and a Python program. When I run the function blinktheLED, it will print ...
1
vote
0answers
4k views

Read Qr-Code from Raspberry Pi Camera in Browser with Flask

Im stuck with implementing a Qr-Code Scanner I found here: https://stackoverflow.com/questions/23538522/scanning-qr-code-via-zbar-and-raspicam-modul I already managed to set up the Raspberry Pi ...
1
vote
0answers
574 views

Sense Hat import error

I made a python program for my Raspberry Pi a while back and it uses my sense hat and motion sensor both connect via gpio by using a TriGpio expansion board and it worked for a while until recently ...
1
vote
3answers
769 views

Crontab task not running script - Permissions?

I've got a python script on my Pi 3 to read a value from an ultra-sonic sensor then write to a db - that alls grand. I've tried to make a crontab task scheduler for it, but it's not working. First, ...
1
vote
0answers
8k views

Connecting a bluetooth device in python using pybluez

wondering if anyone can help me with this. I'm very new to programming in general and am struggling getting my head around bluetooth. I have been trying to follow the examples given at http://people....
1
vote
0answers
151 views

Issue calling commands behind Tkinter

I'm trying to get an audio playback system on a Raspberry Pi to play back a selected sample in Python when the GPIO detects an input from an Arduino, (stepped down to 3.3V). Here a simplified section ...
1
vote
0answers
572 views

Cannot install pip3.5. Pip is configured with locations that require TSL/SSL?

I'm trying to install pip3.5 with python3.5 on raspbian on my raspberry pi, and I can not get it to work for the life of me. I have already installed python 3.5 without problems but I cannot seem to ...
1
vote
1answer
1k views

Kivy on Raspberry Pi: Mouse cursor not showing

I'm running kivy on a Raspberry Pi. I accepted that apparently you can't get around the fullscreen, but I can't get the cursor to show either. I tried by adding touchring = show_cursor=true to the [...
1
vote
0answers
454 views

Audio Issue with Multiple USB Sound Cards

I'm trying to build a simple python program that will capture audio from 2 different audio inputs and then play audio from 1 of them. I bought 2 USB sound cards so I could do this. I started with an ...
1
vote
1answer
406 views

Python's raw_input() function causes problems in systemctl service

I am attempting to create a safe reset switch according to these instructions. I have implemented the interrupt-based solution (listing 1) which runs fine if I start the script from the command line, ...
1
vote
1answer
199 views

Python Code for Home Automation times out

I was making a python script for home automation using Adafruit IO as a conduit between IFTTT and the Raspi, and it works great for a while. But after a few hours, it just stops working. I have no ...
1
vote
0answers
964 views

White Balance Drift off from Pi Camera

I'm currently trying to develop image tracking using color in Python 3 and OpenCV. But i am facing problem in PiCamera. At the moment, i've done some method to fix white balance, shutter speed, and ...
1
vote
0answers
331 views

How do I save an image via imgproc? [Raspberry Pi]

I am creating a project with python and Raspberry Pi. I am trying to use my Webcam, as I, unfortunately burned my Camera Module. I was following along: https://www.cl.cam.ac.uk/projects/raspberrypi/...
1
vote
1answer
289 views

Parallax RFID Serial Not reading tags

I am a complete newbie with Raspberry Pi and any type of hardware prototyping. I have been trying to get a Parallax RFID working with my Pi 3. I currently have it wired to the GPIO using BCM and the ...
1
vote
1answer
5k views

Selenium - Firefox - OSError: [Errno 8] Exec format error

I'm trying to run selenium on a Raspberry Pi 3. I've installed geckodriver and added it to my path. $: which geckodriver /bin/geckodriver echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/...
1
vote
0answers
895 views

VLC Python bindings don't work on PiZero with Justboom DAC Zero

I am trying to setup an audio player in Python using vlc.py bindings, but the simplest of code seems to throw an error. I want it running headless so I am trying all my experiments over SSH. Code ...
1
vote
1answer
1k views

“404 not found” error when requesting Python with Lighttpd through CGI

I've installed lighttpd and gotten it to serve /var/www/index.html just fine, but I haven't gotten it to run a Python script yet. I enabled CGI and set it's match case and directory as instructed in ...
1
vote
0answers
344 views

Python GPIO Script does not work in background

I have written a script to open/close my roller shutter using two buttons and a relay. One button to open, one button to close. Here is my script : import RPi.GPIO as GPIO import time relay_pin = ...
1
vote
0answers
646 views

Can't connect to my Raspberry Pi 3 with a socket

I want to use my Raspberry Pi 3 as a server so I want to connect it via a socket. At first time everything was fine but now I cant connect any more. I get this error: ConnectionRefusedError: [...
1
vote
0answers
691 views

Raspberry 3, python and shared libraries

I want to code something which can remote this robot: Dobot Magician http://dobot.cc/dobot-magician/product-overview.html. I have a Raspberry 3 and I downloaded the precompiled DLL for Linux on Dobot'...
1
vote
0answers
626 views

Pyserial code hangs after a while

I have some code that parses serial data into chunks for Kivy to read. For some reason the code will work perfectly for a while and then stop. I think I need to clear the buffer/memory somewhere but ...
1
vote
0answers
2k views

i2c requires restart before bus access

I have a Pi3 running Jesse and I am running some standard Python scripts to access the i2c bus to read voltage from an ADS1115. After a reboot I have found I need to run the following to allow the ...
1
vote
0answers
597 views

GPIO PCM on RPi 3 B model

I have a decoder from a PCM system. I want to stream digital sound by the PCM pins of my RPi using the CLK, FS, and digital output to complete my PCM system. I have been looking for information, but ...
1
vote
0answers
278 views

Log Raspberry pi time according to GPU (i.e. using real time OS)

Using the below given script, I am able to log camera.timestamp and camera.frame.timestamp. These should ideally be same as they both query GPU System clock time. For example, for 30hz frame-rate, ...
1
vote
0answers
1k views

how to close fswebcam after using it in python

I used fswebcam in python together with os.system() but i do not know how to close it after using it is in a loop that is why I want to close it like the picamera.close()
1
vote
0answers
342 views

Change pip from 3.4 to 3.5

Recently, I have installed python3.5 on raspi, while I had 3.4 (by default). So now I have a problem with pip, because it is linked with 3.4 and not 3.5, so whenever I install package, it is done for ...
1
vote
0answers
1k views

How do I release or free /dev/ttyUSB0?

I am trying to work with raw GPS data from a USB GPS receiver (Delorme LT-20) through /dev/ttyUSB0/. My program had been working, but today I get this error: could not open port /dev/ttyUSB0: [...
1
vote
0answers
412 views

Trouble with Python script from rc.local (TTY issue?)

I have not been able to find a solution to an issue affecting one of my Python programs only when it runs from rc.local. Update added to the end with additional information. A brief description of ...
1
vote
0answers
1k views

How can I use an already installed module when I'm using a virtual environment?

I have created a virtual enviroment on my RPI3 (Raspbian-Jessie), so that I may more easily work with a particular image-searching software (as outlined in this tutorial, step #4). My script requires ...
1
vote
0answers
964 views

How to Tell if Too Many Threads Are Crashing My Multithreaded Python Program?

How can I tell if my multithreaded Python program is crashing on my Pi 3 because there are too many threads? (Or poorly written ones?) My multithreaded program involves three looping threads: a main ...
1
vote
1answer
792 views

Listening to GPIB Bus Communication - Raspberry Pi

I am making use of Prologix GPIB-USB Controller to be used in LISTEN ONLY mode (Device Mode) to decipher data communication between Two instruments namely Tester & Prober. I have written a sample ...
1
vote
0answers
997 views

Python controlling OMXPlayer, DVI and HDMI causes issues in sub process

I hope anyone can help. I have built a Python script that uses a triggering action to start playing a video of a door opening. When triggered, it should start playing the video of a door opening, and ...