Posts Categorized: python

Querying Zookeeper from Python

Install the prerequisites. Below works for Debian-based distros such as Ubuntu/Mint:

Install python libraries:

Example code below shows making a connection, getting the names of some child nodes and pulling info from each of those child nodes:

Unfortunately I can’t get this installed on CentOS.    

Install Python Linters in Atom

I installed the relevant Python packages first e.g.

Then on the Atom menu use: Edit > Preferences then search for atom packages such as flake8, pep8, pep257 and pylint: Then click the install button. After restarting style advice is shown in the editor:    

PhidgetBoard with Raspberry Pi and Tripwire

I very luckily got landed with a: Phidgets Board 8/8/8 (1018) Lanbao PR18S-TM10DNO Photoelectric Tripwire Sensor (3525) I wired the Tripwire sensor to the Phidget board as described in the wiring diagram and as shown in the video: I connected the USB cable from the Phidgets Board to the USB port on a Raspberry Pi… Read more »

Fabric: Getting Started Tutorial

Hopefully this may help someone else out there who is looking for a good excuse to use Fabric in anger. I install Fabric on my local Ubuntu desktop using:

With Fabric installed I created a new directory for playing around and inside that folder created a file named fabfile.py as follows:

With the… Read more »

Beginning Python on Ubuntu

Ninja IDE Python Ubuntu

I am using Ubuntu 12.10 but with Gnome Fallback session rather than Unity. I was testing out Python by creating a little program to notify if the input year was a leap year or not. I found Ninja IDE useful but had to Edit > Preferences and set the Python path to python3 as shown… Read more »