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.

Filter by
Sorted by
Tagged with
36 votes
8 answers
21k views

Detect that a python program is running on the pi

I've got a python script that uses sys.platform.startswith('linux') to test if it is on linux or not, but then I can't tell the difference between the x86/64 processor, and the raspberry pi's ARM ...
user avatar
  • 463
17 votes
5 answers
12k views

Falls off network ("Destination host unreachable")

I am running my Pi headlessly, connecting via SSH over the network. I am having a problem that I can consistently reproduce. I will leave a Python script running on my Pi and come back a few hours ...
user avatar
1 vote
1 answer
2k views

Connecting the HMC6352 compass module to a Raspi using I2C

I am trying to connect a HMC6352 compass module to my Raspberry Pi. According to the datasheet I need to send an "A" for a read command. However, I am somewhat new to I2C and do not know how to ...
user avatar
  • 133
6 votes
1 answer
4k views

Can I control Minecraft Pi Edition over SSH from another computer?

I recently downloaded the Minecraft Pi edition for my Raspberry Pi. The main feature of the Minecraft Pi edition is the ability to interactively edit the landscape using Python. One would expect that ...
user avatar
8 votes
3 answers
18k views

Can I run Selenium webdriver using Firefox as the browser?

I would like to set up the Raspberry Pi as a client that exclusively runs FireFox as a client in a Selenium grid. Has anyone tried and got this to work? Are there any tips or pitfalls that I will ...
user avatar
2 votes
0 answers
346 views

Pi - Detecting hdmi out or power interrupted [duplicate]

Does anyone know of a way to script this? The idea being that using raspbmc / hdmi to TV / Tv USB to Pi mini USB (with a battery for buffer)... You could have your Pi running off the tv's usb. When ...
user avatar
1 vote
3 answers
10k views

How to configure Django/Apache on Raspbian?

I am trying to setup my pi as a python web server. I already have Apache/PHP/MySQL running. I can't find the correct way to configure Django on Apache however. Can somebody help?
user avatar
  • 113
3 votes
2 answers
11k views

How to use OpenGL (ES) through Python

I recently got my Pi and thought to give OpenGL another try. So I searched around for OpenGL Python modules as this would be my first choice as language. Although I'm aware that there are differences ...
user avatar
3 votes
2 answers
5k views

python audio bindings

I'm trying to get python audio input on my raspberry pi. So far I've installed the following: My inquiry looks similar to this one, but I'm not using an audio card, I just have a webcam plugged ...
user avatar
4 votes
1 answer
2k views

Comparison of Python Gui performances

I am building a data visualization application. It is a multithreaded Gui without user interaction. I have 24 widgets that shall be updated any 100ms. 16 widgets are PyCairo rectangles and the other 8 ...
user avatar
12 votes
1 answer
18k views

Sound recording using python

I'm trying to record some sound with RPI using python and pyaudio library and facing a few interesting issues - junky console output when attempting to use pyaudio and lots of noise mixing into the ...
user avatar
  • 942
1 vote
1 answer
2k views

Espeak over python cgi

I am running lighttpd webserver on my raspberry pi (raspbian os). On my small website I have a form which executes a python script via cgi - this part is working okay. Now I tried to call espeak from ...
user avatar
0 votes
1 answer
5k views

Raspberry Pi Python Error

I tried to install distribute or setuptools which has to be done prior to installing pip on the Raspberry Pi. The command used was $ curl http://python-distribute.org/distribute_setup.py | python ...
user avatar
2 votes
1 answer
645 views

Updating wheezy breaks Adafruit_CharLCD

So, just to try and keep the wheezy up to date I did an apt-get dist-upgrade and upgraded a couple of things, among which python. Now, when I try runing the example ./Adafruit_CharLCD.py I get no ...
user avatar
  • 121
32 votes
10 answers
144k views

Running a Python script at startup

This question has been asked quite a few times before but I didn't seem to get it working using the existing information. My Pi runs Raspbian. I have a Python script named dnscheck.py which loops ...
user avatar
9 votes
2 answers
19k views

How do capture audio using Python?

More particularly: How can I use python with ALSA to capture audio input? I'm thinking about doing an oled-based spectrum analyzer for Pi-based audioplayer. One part of the solution is to read the ...
user avatar
  • 1,047
4 votes
4 answers
5k views

Infrared NodeJS

I just orded my RPI a while ago (Haven't recieved it yet), and this is just completely out of curiosity, but will I be able to connect some sort of IR receiver, and get it's input in Node? Or is this ...
user avatar
1 vote
1 answer
1k views

Python SQLite3 select with and operator

I'm pretty new to python and SQLite but have done substantial work with MySQL and php. I'm trying trying to do a conditional select on some data and would like to use the AND operator. The MySQL ...
user avatar
6 votes
2 answers
12k views

USB microphone recording input and audio output

I've got a USB sound card which I'm trying to record from using the standard pyaudio tutorial for recording however I get the following (below). Frustratingly this script actually works on my mac and ...
user avatar
  • 225
5 votes
1 answer
5k views

Zbar Installation

I'm attempting to install zbar on my raspberry pi. I built the source by entering: ./configure make make install I don't get any errors or warnings from any of the above commands. After the install ...
user avatar
0 votes
1 answer
571 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 ...
user avatar
  • 271
16 votes
4 answers
66k views

Execute Python Scripts Via Web interface

I have seen a lot of projects which claim to control the GPIO pins, but I want something a bit different, for example, to be able to blink an LED. Is there a system out there where, via a web ...
user avatar
  • 271
4 votes
2 answers
9k views

How do I wait for interrupts in different languages?

I have a IR photo gate sensor that I have attached to my Raspberry Pi, and it is working nicely as I test with WebIOPi and a C program using the wiringPi library. I would like to use some other ...
user avatar
  • 143
6 votes
2 answers
1k views

Using Quickly to develop apps for Raspberry Pi?

Can Raspberry Pi apps be developed with Quickly on Ubuntu? I know there isn't Ubuntu for the Pi yet but what I want to do is develop the app on my Ubuntu machine, compile it and copy the deb file to ...
user avatar
  • 171
6 votes
2 answers
2k views

Is running a CGI server as root too dangerous?

I've setup my Raspberry Pi with nginx and fcgiwrap as CGI. I wanted to control GPIO ports using a Python script with the Rpi.GPIO library. The problem is that in order to be able to control the ports, ...
user avatar
  • 263
6 votes
4 answers
9k views

Do we need multiple versions of Python?

I am new to Linux and going through my installed folder I can see there are four different Python folders in the directory list. python python2.7 python3 python3.2 Do we need all the four versions ...
user avatar
  • 1,708
20 votes
4 answers
36k views

Using Raspberry Pi to control my AC via infrared

When I'm on my way back home from somewhere, I want to be able to switch my AC on a few minutes before I arrive at my apartment, probably by using my phone to connect to my Raspberry Pi on my desk ...
user avatar
2 votes
1 answer
608 views

sample speed i2c

If running standard release of debian on my Rpi. How fast can I sample the sensor readings through i2c and save values? Why Im asking, I tried to read a DS18B20 and save it,s values (wrote the ...
user avatar
  • 1,210
7 votes
2 answers
2k views

Problem with Python Games

Having eagerly ripped open my newly arrived toy, I've just installed the Raspbian Wheezy image & am impressed that it really does just boot and appears to work - however, the Python Games that ...
user avatar
  • 71
6 votes
1 answer
4k views

BlasNotFoundError when installing Scipy through pip

I'm trying to install Scipy in a virtual env through pip and I'm getting an error that says numpy.distutils.system_info.BlasNotFoundError I've never run into this before and I installed numpy from pip,...
user avatar
16 votes
2 answers
8k views

How do I read a button through the GPIO?

I considered myself out of this sort of beginner level stuff a long time ago, but I guess I'm not as smart as I thought I was because I seem to be having an exceptional level of trouble with it! So I'...
user avatar
  • 161
14 votes
4 answers
6k views

How to include RPi.GPIO in a python CGI script with lighttpd?

I've recently setup python to work with lighttpd via CGI (see here). But the minute I go to include RPi.GPIO, the script stops executing (I'm assuming because no HTML gets output), but there is no ...
user avatar
34 votes
6 answers
50k views

Recommended GUI toolkit for Python development on the Raspberry Pi

I am teaching my daughter Python (and myself to some degree) using the Pi, and we have had a great time so far - but the CLI can only take us so far. I have started looking at other toolkits, ...
user avatar
  • 735
27 votes
2 answers
47k views

How to get Python to work with Lighttpd?

I've got Lighttpd setup on my Raspberry Pi, but I'd like to get server-side code working now. I'm familiar with PHP, but I figure I should try Python as it's supposed to be the "go to" language for ...
user avatar
16 votes
3 answers
31k views

Can anyone recommend a simple image viewer?

My boss asked me to find a cheap mediaplayer for some stuff at work. That inspired me to build something on my own, using a Raspberry Pi. My plan is to use udev-rules, to detect usb/sdcard and then ...
user avatar
  • 163
3 votes
0 answers
297 views

Detecting dot11 association packet, etc. [closed]

I actually encountered some problem of detection on Scapy and Python. Okay, I started with creating mon0 by airmon-ng after which my I ran my script: if p.haslayer(Dot11AssoReq): print p....
user avatar
  • 31
13 votes
2 answers
6k views

Why does python run relatively slowly?

I've been benchmarking the Pi on some of my simulation codes, relative to a couple of laptops I have. My codes tend to be floating point intensive, so I've been using Raspbian (which turns out to be ...
user avatar
13 votes
4 answers
66k views

How can I connect to a USB serial device?

I have a device with a USB serial port cable that I'd like to connect to my Raspberry Pi. The chipset for this USB to serial cable it the PL-2303 from Prolific Technology, Inc. How can I read data ...
user avatar
  • 235
19 votes
5 answers
18k views

Which Python IDEs/interactive shells are best suited to the Pi?

I know this is perhaps slightly dodgy teritory, but I'm going to go ahead. I'm wondering which of the many python IDEs/interactive shells are best suited to the RPi? By this I mean low RAM, and ...
user avatar
  • 2,220
11 votes
1 answer
1k views

Is it possible to communicate with i2c devices via the GPIO? [duplicate]

Is it possible to communicate with i2c devices via the GPIO? Also, are there any existing drivers or libraries that make this possible from Python?
user avatar
31 votes
2 answers
44k views

How to program a USB device with Debian/Python

The Pi is being promoted as an educational device primarily for Python. Inline with this, there have already been some great examples online of people accessing the GPIO from Python. However, most ...
user avatar
  • 1,399
28 votes
9 answers
25k views

How can I control an RC servo?

I'd like to control a small RC servo (5 V, 500 mA) from the GPIO pins via Python. Hardware What are the required electrical connections? Can I connect multiple servos to the Raspberry Pi?...
user avatar
  • 7,385
29 votes
3 answers
9k views

How can I use the GPIO pins as digital outputs?

I've read that the Raspberry Pi has a number of input and output pins. How can I switch them? (from Python?) What voltage logic? Do I need pull-up or pull-down resistors? Do I need to switch the pins ...
user avatar
  • 7,385

1
58 59 60 61
62