Questions tagged [python-3]

Use this tag when referring to the Python 3 language. This can include discussions about specific features unique to the language or perhaps when referring to software that requires Python 3 in order to function. Note that general programming questions are often better suited to Stack Overflow; use this tag only where directly relevant to the Pi.

110 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
378 views

Accelerated Numpy on Pi 3 B+

I'm looking to do some work with NumPy on my Pi 3 B+, and I'm not sure what the deal is with optimization, blas, etc. I installed libatlas using: sudo apt-get install libatlas-base-dev Following ...
2
votes
0answers
26 views

Pin Crosstalk Issue

I'm working on a quick project with my dad for his condo. He wanted to setup a bunch of moisture sensors around the condo near sources of water (sinks, bathtubs, toilets, etc), which, if triggered, ...
2
votes
0answers
34 views

How to run 3 Input scripts from 1 script

I've got an alarm system with 3 inputs and 3 outputs. But so far each input is controlling the outputs from it's own script. I did this because I wanted to get one thing at a time working on its own. ...
2
votes
0answers
43 views

Detecting “No Mouse Movement” in python on Raspberry Pi

So this is going to be a bit confusing but using a basic loop i can detect keyboard and mouse inputs using the following: globals()['keyboardEvent'] = evdev.InputDevice('/dev/input/event0') globals()...
2
votes
0answers
401 views

Difference between Thonny and Python 3 (running some code)

I'm just starting with the pi and to be more clear I'm spending time working with the Raspberry Pi Workshop for Beginners series on Youtube.To write an run code we use the Python 3 IDE but I don't ...
2
votes
0answers
664 views

Enabling I2C resulting in error Raspberry Pi

I am trying to use MPU 6050 on raspberry pi. For that I enabled i2c on raspi. But after that whenever I am trying to check the modules on my Python 3 or 2 shell for e.g. when I run help('modules'), I ...
2
votes
0answers
2k views

Segmentation fault, running out of memory? PyQt5

I am programming code to display camera feed with my raspberry pi 3 and Raspbian. Strangely, sometimes the code shows the video and sometimes i get the Segmentation fault error. I used gdb to find ...
2
votes
0answers
5k views

Want to Read COM Port Data and Write into TKinter Text Window

Using Python3, I want to read data on a serial port and display it into a tkinter GUI text window (not only the shell). Pretend I am trying to make the equivalent of a serial port character display. ...
1
vote
0answers
21 views

softly increasing and decreasing volume with mpg123

I am using Picroft on raspberry pi 3. In picroft, every mp3 files run with mpg123. I am creating my own device using this OS. when I say it to sing a song it starts singing by playing mp3 files and ...
1
vote
0answers
26 views

Making Python3 default on command line

I have been trying to run the Jupyter notebook on my Pi but the Kernels will not install into Jupiter even though I downloaded them through the Pi's Software download window. A little bit stumped and ...
1
vote
0answers
13 views

Launch a python script in a lxterminal window using supervisord

I'm trying to launch a python script in a lxterminal window using supervisord. I'm stuck on using supervisord than a .desktop file. I'd like to keep the process running on loop Below is my config: [...
1
vote
0answers
34 views

How do I access pixel values from a raspberry pi camera?

I am writing an AI program in Python on a raspberry pi, where I need to access raw individual pixel values from a raspberry pi camera. I really don't want to save the picture, I want to process the ...
1
vote
0answers
60 views

A PWM object already exists for this GPIO channel

I have a bit of a dilemma. I am currently using BCM GPIO 14, 15 and 18 to control an RGB status LED using PWM. I have configured my raspberry pi 3 to pull down pin 14 (red) on boot, to indicate the ...
1
vote
1answer
33 views

RPI project Minecraft Server

me and a project partner are running a Minecraft server off of a RPI and connecting via its wireless feature. we wanted to create a python script which would control an LED and toggle it on/off based ...
1
vote
1answer
50 views

Allowing a venv instance of Python access to I2C

I'm trying to run a python script using the adafruit_bme280 library to read a couple of sensors and display the data on a flask-generated page. I've gotten it to work outside of a venv virtual ...
1
vote
0answers
65 views

Raspberry Pi Touchscreen Screen Control (Python)

I want to create a script that will turn off my Raspberry Pi Touchscreen if nobody touched the screen in 30 seconds. (In the future I want the option to reset this 30 second timer with other programs -...
1
vote
1answer
76 views

Pigpio not calling Callback for first rising or falling edge

I have some sample code (taken out of my larger program) that regularly (but not always) missing the first rising edge: #!/usr/bin/python import pigpio, time def callback(g, l, t): print("Callback ...
1
vote
0answers
32 views

Cant read both SPI Buses of Raspberry Pi 3B+

I want to read 3 analogue sensors simultaneously. I have successfully connected 2 sensors using a MCP 3002 A/D converter which is connected to CS0 of SPI 0 of raspberry pi and I have activated 3 more ...
1
vote
0answers
269 views

Installing scipy on python 3.7 with raspbian

I followed the guides for installing python 3.7 and the installation went without issue, and code I write can run just fine. Installing other modules like numpy and matplotlib doesn't result in any ...
1
vote
1answer
49 views

Can't get HC-SC04 Sensor to work

I'm using a Pi Zero W with a soldered project board to interface two ir Sensors and trying to make an HC-SR04 sensor work. I'm using the 5v supply to power all three sensors. I've set up a Motion.py ...
1
vote
0answers
54 views

MPR121 capacitive touch is sensible enough?

I have a Rapsberry Pi 3 A+ with an Adafruit Capacitive Touch HAT for Raspberry Pi (MPR121) and the idea is to plug it to the wet soil of a plant and it detects when I touch the plant (or a leaf) and ...
1
vote
1answer
61 views

Retrieve data from Smart Plug via Raspberry Pi (need help with python script)

I am using a tutorial from BeardMonkey in order to retrieve and store the measured data from a smart plug (a smart plug is monitoring the power consumption of my kettle at the moment) https://www....
1
vote
0answers
42 views

raspberrypi3 bluetooth socket problem

I have write program for raspberrypi3 bluetooth communication with hc05 ,but most of the time I am getting error bluetooth.btcommon.BluetoothError: (110, 'Connection timed out') how can I solve ...
1
vote
0answers
40 views

PiCamera python : buff/cache memory keeps increasing

I need to take a picture in each second in an infinite loop. I've wrote 2 different python scripts: one with camera.capture() and another with camera.capture_continuous() In both cases, I see the ...
1
vote
1answer
78 views

Accessing a Virtual Environment from IDLE3 shell?

On my pi3 I have created a virtual environment with Python3. I run my pi headless, using my Windows 10 PC. I access the pi with 3 apps: - PuTTY for terminal usage; - WinSCP for a file Explorer; and ...
1
vote
0answers
172 views

Not able to install the latest version of Scipy(1.2.0) on Raspbian

I have Scipy version 0.18.2 on my RaspberryPi 3. However, I need the find_peaks() function which is only available on higher versions. I followed this link to install scipy. But the python3 setup.py ...
1
vote
0answers
84 views

Pi-3, Model B, SenseHat - How can I restart my code while it's active.?

I am new with python and PI. I have been looking all over for information about this but with no luck. currently it works like this: I start the program, I press the button and then it starts counting ...
1
vote
0answers
211 views

Send data BMP180 between client and server trought module socket

I would like to send data of BMP180 sensor between a client and a server with two raspberry pi 3 being that the client when executing the command get the server will give the temperature value to the ...
1
vote
3answers
926 views

Raspberry Pi won't recognize nRF24L01+

I'm a Raspberry Pi n00b and a python beginner, but I have a lot of experience with DIY electronics, arduino and c#. I've tried everything I can think of, and I just can't get the Pi to recognise the ...
1
vote
1answer
149 views

Camera pretrigger capture

Hi i want to make a program that will continually record a video and on a press of a button, it will save 2 minutes before i pressed the button is it possible to do it somehow ?
1
vote
1answer
246 views

How to programmatically check bluetooth speaker is connected to rpi3?

I am trying to detect if my bluetooth speaker is connected to my rpi3 with my python code, executing this command status = subprocess.call('ls /dev/input/event0 2>/dev/null', shell=True) if the ...
1
vote
0answers
503 views

usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

I am running Rasbperry pi and have the pyusb module installed. The printer is Bus 001 Device 004: ID 0fe6:811e Kontron (Industrial Computer Source / ICS Advent) Parallel Adapter, and it's idVendor and ...
1
vote
0answers
120 views

Python 3 Debugging Symbols for Raspbian Stretch

I am trying to track down a segfault when using Pip on my Raspberry Pi Model 3B running Raspbian Stretch. I've configured the pi to do a core dump, and I've gotten gdb to load the core. The ...
1
vote
0answers
40 views

Raspbian Python Package installtion errors, Parselmouth

I am trying to install this package, praat-parselmouth, however the installation does not move forward after getting stuck at either "Running setup.py bdist_wheel for praat-parselmouth" or if ...
1
vote
0answers
542 views

How can i emulate a ps/2 keyboard with raspberry pi3

So I am working on an medical machine which runs on microcontroller(So,No OS).It gets the input from ps/2 keyboard. I would like to automate it. I would like some basic idea and some help on how to do ...
1
vote
0answers
323 views

Block Raspberry Pi from quitting fbi fullscreen (HDMI) to command line

I'm developing a parking control system in Python 3 which runs in headless mode at the Raspberry Pi startup and uses one RFID reader, one Barcode reader and many other devices but they really don't ...
1
vote
1answer
1k views

After installing python 3.6 most modules don't work

I'm new with RPi and also Linux, so my question might be stupid but I tried to get Python 3.6 running with different ways (compiling, pyenv, berryconda). In general I think python is running on all ...
1
vote
1answer
1k views

GPIO event handler triggers off rising and falling edges

I'm trying to set up a tachometer. I used a comparator IC to get a real clean signal on pin 21 but I'm getting iterrupts on the rising AND falling edges. #!/usr/bin/python3 import time import ...
1
vote
0answers
374 views

I keep running into missing elements with GStreamer

I have tried uninstalling and reinstalling GStreamer on the Raspberry Pi 3 and I keep finding that I have missing elements. This is the Pi on Log Level 4 (GStreamer): This is my laptop, running ...
1
vote
1answer
727 views

PWM object's ChangeDutyCycle method is not working

I have a motor class but I dont' know why this motor cannot change speed class Motor: def __init__(self, pos, line_status=0): def set_motor_gpio(_a, _b, _pwm): self._A = _a ...
1
vote
0answers
506 views

IR Tracking Sensor (TCRT 5000 ) always gives led off as output

I am using a Raspberry PI3 Model B and TCRT 5000 sensor to monitor movement. I am using a Python script(Python3) to read the data from the sensor. Script used - #!/usr/bin/env python import RPi.GPIO ...
0
votes
0answers
5 views

Can I save and open multiple videos with OpenCV or any other module/package/method

So, I have been working on a project which requires me to open an animation/video if the user gives an input of a recognized string mentioned in my code. Basically if the word entered by the user is ...
0
votes
0answers
9 views

How to Volume control PAM8610 from RPI

Does anyone know how can I control PAM8610 module volume through code from RPI? Thanks.
0
votes
0answers
18 views

Simulating OpenCL on a Raspberry Pi using Python

Is it possible to run code on a Raspberry Pi which simulates the use of OpenCL? I am developing code on a computer which is capable of using OpenCL, and am testing this code remotely on a Raspberry ...
0
votes
0answers
27 views

ALSA Errors on Pi 3B+ using SpeechRecognition and PyAudio (Original Post missing stuff)

Using PyAudio I simply ran this piece of code: import pyaudio p = pyaudio.PyAudio() for x in range(p.get_device_count()): print(p.get_device_info_by_index(x).get('name')) Getting these Errors: ...
0
votes
0answers
10 views

Binding PiCamera stream to GstWidget

Well, today I began to program in Python and I'm doing a graphical app with PyGtk in Anjuta. My first objective is to get the stream of the PiCamera in a window. But I'm getting problems to manage the ...
0
votes
0answers
20 views

Detect fire with pi cam module

I have a python script that uses a usb cam to detect fire with opencv, it worked well until changed to the picamera and now i get this error when i run the code: File "seeFire.py", line 23, in ...
0
votes
0answers
17 views

error while opening the default python3 install in raspbian

well, i have been using python3.4.2 for sometime on my raspbian os however recently i tried to change the default to 3.7.2. unfortunately i failed to do so... i downloaded it but i couldn't make it ...
0
votes
0answers
22 views

php file not executing python script when called through browser

I have an apache2 webserver running on the pi. I have a php file that uses exec() to run a python script. Everything works well from the command line. when loaded through the browser, the exec() ...
0
votes
0answers
18 views

Simulate a mouse click in python tkinter

I have a tkinter GUI running on a Pi 3B+ with a 5" tft touch screen display. I am writing my own touch screen driver. The GUI works when I mouse click on a button that is bound to Button-1. self....