Category Archives: Python

Gentoo default Python interpreter

Gentoo default Python interpreter is set to version 3.1: ~ # eselect python list Available Python interpreters: [1] python2.6 [2] python3.1 * Command to change default interpreter: ~ # eselect python set 1 And now interpreter version is 2.6: ~ … Continue reading

Posted in Linux, Python | 1 Comment

Gentoo web2py daemon

Gentoo RC init script for web2py framework Save as “/etc/init.d/web2py” To make a file executable: chmode +x /etc/init.d/web2py Add to default runlevel: rc-update add web2py default Start daemon: rc-config start web2py

Posted in Linux, Python | Leave a comment

Python GUI calc

Python GUI experiment. Simple calculator application made with Tk. It’s a first choice because it’s integrated into Python, simple to use and powerful enough for most cases. It’s also cross platform like an interpreter. However, there are many other libraries … Continue reading

Posted in Python | Leave a comment

MaxSonar sensor and pySerial

LV-MaxSonar-EZ0 sensor by MaxBotix. Interfacing with computer serial port and Python via pySerial module. Download Python and pySerial. The wiring is so trivial. Start from data sheet we need 4 pins: GND, VCC, TX, RX. Sensor operating voltage is from … Continue reading

Posted in Python | Leave a comment

Curve fitting with Python

First we need a NumPy and MatPlotLib modules. Look at curve fitting explanation from wiki. Second degree polynomial equation would help us: y=ax^2 + bx + c This will exactly fit a simple curve to three points. Using more points … Continue reading

Posted in Python | Leave a comment