Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.

learn more… | top users | synonyms

0
votes
0answers
3 views

Can I connect to Multiple Bluetooth devices using a Bluetooth dongle?

I am using a usb bluetooth adapter on my PI 2 , which communicates to an arduino using HC-06 Bluetooth module. This script runs to connect to that module: #! /usr/bin/python import serial from ...
0
votes
2answers
34 views

Can't run python script from cron

Running latest version of Rasbian and want to execute /home/pi/temp.py from cron every 2 min. Have chmod 755 on the file When I run the command from the prompt it executes fine and the script does ...
0
votes
0answers
34 views

opencv2 python script and UV4L server trying to access PI camera module at the same time

I'm trying to use an opencv2 python script and UV4l-server to stream a live feed, from a NOIR camera board on my PI, but am running into problems. The python script runs and displays the window, but ...
-1
votes
0answers
23 views

Can anyone please tell me the python code to convert .h264 video format to .mp4 format? [on hold]

I have used avconv, ffmpeg and also MP4Box. But when i use these in my python program, its showing syntax error. Can anyone please help me out finding a way how to convert .h264 to .mp4 in python ? ...
0
votes
2answers
20 views

How should I properly communicate 2 Raspberry Pi via UART?

I'm testing serial communication with Python pyserial module. I try to communicate some strings between two Raspberry Pi's ... I tested transmitter and receiver code at same device connecting it's ...
0
votes
1answer
30 views

How can I use a LCD display with a I2C adapter?

I'd like to try to communicate to a 16x2 LCD display, however whole docs I found assume I should connect the whole pin-out however I got some kind of I2C adapter from mjkdz.com which makes a 4 pin ...
0
votes
3answers
56 views

How to blink LEDs on/off continually, while continuing execution of a script?

I've connected red and green leds via GPIO and I can successfully switch them on/off using RPi.GPIO - now I'd like to: start an led blinking on/off every 1 second have the script continue its ...
0
votes
0answers
27 views

Raspberry Pi stream video over RF

I would like to stream video from a Raspberry Pi over RF to another Raspberry Pi. Here are a few requirements: Range of at least 1KM (pretty much line of sight) I would also like to send some data ...
0
votes
0answers
7 views

pymodbus to read temp from device

I am trying to us pymodbus to read data from a temperature and pressure device, but it seems the output from my readings is always None. Here is my code import pymodbus import serial from ...
0
votes
0answers
17 views

How to view output of tty1 script through SSH [closed]

I have a python script that begins automatically on boot. Is it possible to view (or log) the output of the script--a scanner that keeps running and outputting information--through SSH? I know I can ...
1
vote
2answers
89 views
+100

How to connect 7-segment 4-digits display with Pi?

I would like to connect such a 7-segment 4-digits display (with common anode) to the Raspberry Pi: What's the simplest way to do it with Python for example? Do I need the RPi.GPIO package? Is there ...
1
vote
0answers
19 views

Nginx passing calls to Python Socket [closed]

Have installed Nginx on Raspberry Pi 2 and its working. Also have added a default HTML page with a text box, and I can access the page over the local Network. So is there a way to pass the text in ...
0
votes
0answers
11 views

Python serial script prevents android connection

The python script below connects via "rfcomm0" to the "Bluefruit EZ-link module" on the "Arduino Uno" but prevents the bluetooth connection from my android app. If I change the script to use ...
1
vote
1answer
39 views

I2C LCD detected, code runs, but no display

I'm trying to drive a 16x2 LCD board with i2c and running into some unexpected results. Basically, I can detect it, talk to it with my code, but nothing shows up on the screen. Same screen when ...
0
votes
1answer
42 views

http streaming functionality with password

I'm trying to add some http streaming functionality to an existing python motion detection script. The script already uses the uv4l driver to access the raspberry pi camera, so I thought I'd try ...
0
votes
0answers
23 views

Control Python code using iPhone Gyro Data [closed]

i have a python script to control an rc car and i want to pass iPhone data (ondevicemotion) to the raspberry pi to execute the code. Whats the best way to go about this ? web sockets in python or a ...
0
votes
0answers
40 views

Raspberry Pi Frequency Calculator

I'm trying to make a simple program that calculates the frequency at a pin on the board. I'm using Python for the programming. I wrote two different programs and they gave the same (wrong!) results. I ...
0
votes
1answer
54 views

Record Video using a for loop

I am using RPi 2 Model B with a RPi camera module. I'm coding on Python and need to record a video while operating a motor. The code I'm working with looks something like this with ...
0
votes
3answers
85 views

Run two python script automatically on Headless raspberry pi project

I'm doing a project where raspberry pi runs headless. I have written two python programs, one for swiching off the raspberry pi via gpio push button and the other is a opencv-python program. I need to ...
0
votes
1answer
34 views

Receiving junk datas from the serial port of raspberry pi

Iam doing a project in which i need to read datas send from a ZIGBee through the serial port of raspberry pi. I have done removing that ttyAMA0 stuffs from /dev/cmdline.txt and commented that line in ...
0
votes
1answer
27 views

What can I use to program a basic game in Python?

I've just started to program games, but I want a 3D game engine for Python like Phaser for Javascript. Any help would be highly appreciated. Thanks.
0
votes
0answers
7 views

Enable cursor keys in python shell in Pi over ssh [migrated]

I run OpenElec on a Pi. I can ssh to the Pi and open a python shell. How do I enable the cursor keys to work like up getting to last command in the python shell, like it does on my Ubuntu box. Now ...
2
votes
1answer
41 views

Accessing ADXL345

I'm trying to access an ADXL345 Accelerometer mounted on a Sparkfun breakoutboard via Python and I2C from a Raspberry B+. I'm following this tutorial However when trying to check for the sensor with ...
1
vote
1answer
16 views

png file in same folder as pygame file but not working

So i am on raspberry pi 2 and I am trying to make a game and i have the .py file in the same folder as the png but its still not working. it gives me this error: Also im using pycharm ...
0
votes
1answer
24 views

KeyboardInterrupt Handling with picamera

So I have a python program in which I'm using the picamera library to shoot pictures and record video. I'm using my program for scientific purposes and my goal is keep each picture as close to the ...
0
votes
0answers
34 views

controlling 12 V RGB LED strip with raspberry pi

We are trying to control a RGB led strip with a 12 V power supply. The servoblaster does not work. Can you please suggest some other software we can use?
0
votes
2answers
87 views

Python Script Stops Running After about 3 Hours

I realize this is a somewhat vague question, but, I have a python script that needs to run for two years on a raspberry pi and is failing after about 3 hours. Without getting into to much detail as to ...
0
votes
0answers
30 views

LIRC with Raspberry PI , problems

I am trying to get my SONY CRS60A IR remote to work with LIRC and raspberry pi 2. Here is the setup : That is what my setup looks like. When I run mode2 -d /dev/lirc0 , I am able to read the ...
1
vote
2answers
94 views

Unable to see Temp sensors at /sys/bus/w1/devices which was working until SD card got corrupted

I have several DS18B20 sensors wired to my Raspberry Pi and wrote a python script to read them all. I've had the script running for months without a problem. Last week I performed an update and an ...
0
votes
1answer
34 views

having problem with GPIO switch

I have been working on a project that will allow me to take picture using a switch. So for that purpose i setup the GPIO and all necesseary tools for that code, Python-dev and etc. When i run the ...
0
votes
0answers
99 views

Different “Adafruit 16x2 Character LCD + Keypad for Raspberry Pi” Python Libraries & Sunfounder plate

I have the SunFounder I2C interface 16x2 LCD Pi Plate with KeyPad with RGB LED for Raspberry Pi plate (this model available at Amazon (sorry I have only the german link - the picture is showing the ...
0
votes
0answers
50 views

Does this show PyAudio is unusable on RaspberryPi?

I want to use PyAudio to play audio on Raspberry Pi. This seems to be the easiest thing that should be possible to be done! If this is not possible, this would prove PyAudio is unusable on ...
0
votes
0answers
22 views

pi web server php page which calls Python- fails. Should show a screengrab when refreshed

I have some python code that runs as expected from Idle or Python, saving a screengrab. #!/usr/bin/python2 import pyscreenshot as ImageGrab im=ImageGrab.grab() im.save("screenGrab.gif") My web ...
0
votes
2answers
75 views

code works on windows laptop but not on PI

I'm calling this function on my laptop with (python version 2.72) and it works well; but when I move it to my PI (python ver 3.2.3) I get: Traceback (most recent call last): File ...
-2
votes
0answers
9 views

Need Python program for controlling 4 DC motors [duplicate]

I have connected the motors(4 in numbers) with the GPIO pins and I am able to run them for a certain amount of time using python, but I need to program them in such a way that all the motors will ...
-1
votes
1answer
29 views

Glade UI Python serial read loop

I'm writing a python program to monitor for serial activity, and when there is serial activity, to increment a number. When inside the while loop, no other functions will work and I can't modify the ...
-1
votes
0answers
39 views

Xbee Communication with raspberry pi [duplicate]

I am looking for a way for two raspberry pis to communicate with eachother via Xbees. There is very little documentation online about this. My goal is to send a bunch of integers between the two pis ...
-1
votes
0answers
27 views

Need a python program for DC motor control [duplicate]

I have connected the motors(4 in numbers) with the GPIO pins and I am able to run them for a certain amount of time using python, but I need to program them in such a way that all the motors will ...
1
vote
1answer
121 views

Displaying image from PI via ssh and xming on my PC

Firstly, I've googled around, but got myself horribly confused; hence this question. I have a headless/keyboardless Raspberry pi with a camera board on it, that I connect to via ssh using my windows ...
1
vote
2answers
105 views

Python script with loop that detects keyboard input

I have a python script that uses a library to talk to GPIO in a constant loop. How can I detect keyboard input inside the loop and choose to exit the loop? while True: for item in pics[1:]: ...
0
votes
1answer
42 views

Periodic Polling - Minimum Resources During Sleep

I am looking for a Pi 2 B to run 3 separate python background tasks simultaneously/constantly: Respond to pin inputs, respond to UDP requests and send UDP data back and poll a set of temperature ...
4
votes
2answers
330 views

Raspberry Pi starting programs automatically on startup

I've built a wireless sensor network consisting of two Raspberry Pi's (runnnig Raspbian) with sensors on and a base station Raspberry Pi that collects the data. Each time I want to run the system I ...
0
votes
1answer
48 views

Python, C, I2C, calling binary with arguments, and printing output

I have a C binary that takes 1 argument. I need to have Python run the binary, and return the output. Using subprocess.Popen (and check_output), the C binary fails when trying to write to the I2C ...
2
votes
3answers
109 views

Python and OpenSSL error on import

So I'm trying to add SSL to my web server running on my pi B+ (using cherrypy) I made sure that OpenSSL was installed with: sudo apt-get install openssl Then I installed pyOpenSSL with: sudo ...
0
votes
0answers
35 views

ImportError: No module named HT16K33

When I am importing a library (specifically Adafruit_LED_Backpack using Python3) I get the error ImportError: No module named HT16K33 How do I install that library? EDIT: when using Python 2.7, the ...
0
votes
0answers
6 views

Create a playlist using pygame.mixer [migrated]

I have been trying to make a simple playlist that plays 3 songs one after the other the code below shows an attempt of that. Rather than playing the first song music1.mp3 it plays the last song ...
3
votes
1answer
91 views

Raspberry Pi Camera - When is it ready for next frame

When using apis like the C++ or raspicam api, you poll the camera with a grab(), or similar, method. When a frame is ready, the method returns. Is there a way of checking if the camera is ready ...
0
votes
1answer
86 views

HC-SR04 distance sensor doesnt work

I try to make HC-SR04 distance sensor on my rasp pi robot but it doesnt work and I don´t know where is problem. Here is my python code. Program stop in first while loop. VCC is connect to PIN 2. ...
4
votes
2answers
170 views

Building a Raspberry Pi network monitor. My code is not working

Long story short. I moved, put my home server is a closet and started worrying about temp and humidity, saw a guide online to make a network temperature and humidity monitor from a rasberry pi and an ...
0
votes
1answer
55 views

Is there a way to see if a GPIO pin is on or off using the python RPi.GPIO module?

I have a relay connected to the RPi. Pin 12 for output on/off and grounded with pin 6. Currently I have two python scripts one for turning pin 12 on and another to turn it off. My goal is to run a ...