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.

625 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
532 views

ShiftBrite - running on Python

I was wondering if anyone can help me out with converting the example Shiftbrite Arduino code into Python so I can run it on my RPi. Here is the example code in question: int datapin = 10; // DI int ...
0
votes
1answer
88 views

How to make a simple GUI?

I recently had follow this tutorial which basically is about making your raspberry pi send email notification every three seconds on the location of your device. The thing that is missing now is, I ...
0
votes
1answer
220 views

USB RS232 turn on/off beamer

I'm streaming a video to a beamer. But I want it too turn it off after office hours. I found /opt/vc/bin/tvservice -o and /opt/vc/bin/tvservice -p to turn off the screen. But that does not turn off ...
0
votes
1answer
1k views

I can't install anything with pip

Every package I try to install using pip, I get this error. I already updated the pip but even so doesn't work my pip version is 9.0.1 Exception: Traceback (most recent call last): File "/usr/...
0
votes
1answer
727 views

MPU6050: Two sensors receiving same data

I am using the Raspberry Pi 3 Model B to read in two MPU6050 sensors at the same time. I faced some initial problems in setting up everything but now I am able to read in data relatively fast. My ...
0
votes
1answer
75 views

I am trying to turn on a led using a switch in Raspberry pi. Now when I am trying to run it in python command shell it says: command not found

import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17,GPIO.IN) input = GPIO.input(17) while True: if (GPIO.input(17)): print("Button Pressed") import time prev_input = 0 ...
0
votes
1answer
226 views

Is this normal for a pin diagnostic?

I'm trying to do the simple hello world of the pi world. I have been having problems actually turning pin 7 off. I tried moving my rib position in the socket (flipping the white side facing the sd ...
-1
votes
0answers
8 views

pocketsphinx.c - Writing raw audio file - segmentation fault

I am working on a smart home system project that uses speech recognition. We have 2 raspberry pi devices. The source code, written in python, works perfectly on one of them but crashes on the other ...
-1
votes
1answer
44 views

Creating a Day Counter

Does any one know the best way for me to make my PI count the days since an action was performed and display the value every day, I basically want my pi display to tell me how many days have passed ...
-1
votes
1answer
164 views

Unable to run python script on boot

I wrote a script for object detection and if I establish ssh connection to Raspberry Pi and run it from console, everything works fine. As I would like to start the script automatically on boot, I ...
-1
votes
2answers
519 views

How to run a python program from a bash script on startup?

I have a python script that is located at /etc/testscripts/WebServer. I call this usually from the command line by calling sudo python3.6 /etc/testscripts/WebServer. I have a bash script that looks ...
-1
votes
1answer
833 views

How to remove the kill prompt of a python script?

I have a python script that uses Tkinter, the quit button I have implemented pops up a prompt on the python shell after pressing it, which it didn't do on Windows when I wrote the code and tested it. ...
-1
votes
1answer
221 views

raspberrypi - on boot not running my infinite python script?

I have a Python script, which needs to run 24/7 to use GPIO high/low. So on boot i wanted it to run as below. But it never works to run python script on other hand it does create /tmp/test file? How ...
-1
votes
1answer
395 views

How could I use Wit.ai to get speech to text on my webpage running python script

I want the speech to be recorded by raspberry, send it to wit.ai and then get the response on my page(wich is actually the .py script and according to which I could run my conditions). Actually its ...
-1
votes
1answer
3k views

Reading all channels MCP3008

I have a problem with reading data from adc convertor MCP3008 10bit. I found a python script from adafruit that give data value from all channels (CHO TO CH7). I added a picture with my results and ...
-1
votes
1answer
161 views

Adafruit's LCD doesn't show text

I've just written small python script to operate adafruit's lcd with additional module. Almost every lcd's operation is handled by module. But when I try to print a message on screen or in console, ...
-1
votes
1answer
359 views

Use Pi 3 With Waveshare 3.5" and MFRC522

This message showed up when I was using MFRC522 along with Waveshare LCD 3.5"(A) on Raspberry Pi 3: python Read.py can't open device: No such file or directory Aborted I think it's because SPI is ...
-1
votes
1answer
2k views

Connecting to bluetooth speakers headlessly

Background: I have a Pi Zero that I want to send music to my bluetooth speakers. This works nicely when I have a monitor and can use bluetoothctl to pair and trust my speakers and the volume-adjuster'...
-1
votes
1answer
42 views

Newbie python issue

I'm trying to write some code to drive a Sense Hat ' I want to use an LED line to indicate the temperature, then scroll it up over time. The sense.set_pixels function expects a list of 64 RGB lists, ...
-1
votes
1answer
894 views

Will an automated scp script share files between Pis without Passwords?

I am planning on sending some files within an Ad-Hoc network of Pis. Build Raspberry Pi - 2 Model B Debian Wheezy 7.10/7.11 I am planning to run a cron job between the Pis in vicinity. Through ...
-1
votes
1answer
614 views

Error message every time I try to install applications

Error processing line 1 of /usr/lib/python2.7/dist-packages/gtk2-2.0-pysupport-compat.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 162, in addpackage if ...
-1
votes
1answer
143 views

can't work xx.py using crontab

I can send the value to domoticz but the problem is that it just changed when I use the command sudo python distance.py I have added * * * * * /usr/bin/python /home/pi/domoticz/scripts/...
-1
votes
1answer
192 views

Python Face Recognizer Error

I got this error during compilation.
-2
votes
1answer
40 views

Start program when a device connects to local wifi

I'm looking for a python program that could detect when device has connected to a local wifi and start a specific program. And would communicate via SMS with raspberry pi.
-2
votes
1answer
39 views

Run a fan 5scs long GPIO

def fan_on(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) FAN_PIN = 23 GPIO.setup(FAN_PIN,GPIO.OUT) GPIO.output(FAN_PIN,True) This is my code to run a fan on my rpi via GPIO ...