Last week I discovered Listen, yet another music player/database written in Python for the Gnome desktop. I tweeted it and I think it looks quite nice; has issues though, so I decided to jump in and fix some stuff. For example the cover fetch from Amazon. Amazon decided to require a signature for each REST [...]
Archives for posts tagged ‘Python’
cx_Oracle: Error after setting NLS_LANG
Thursday, 28 January 2010
I am working with a database containing Unicode data in NVARCHAR2 fields. Selecting rows that contain those fields just works with current cx_Oracle and SQLAlchemy as long as I don’t actually try to limit my result set by one of those in the query (like ‘%ü%’). I tried it with PL/SQL Developer and like unistr(‘%\00fc%’) [...]
flot: Javascript plotting for jQuery
Saturday, 23 January 2010
When eye-candy and function meet, you get perfection. Now add ease of use and offloading of a few CPU cycles to the client and you get flot. It’s a JavaScript library for jQuery that creates beautiful diagrams from your raw data… just like that. It just works.
Take a look at this… awesome!
This picture was generated [...]
Python: Building MySQL-python 1.2.3c1 on Solaris 10 with MySQL 5.1.42
Thursday, 14 January 2010
Trying to build MySQL-python from source on Solaris 10 when using MySQL 5.1.42 (pkg from mysql.com) may fail with something like this:
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,’gamma’,1) -D__version__=1.2.3c1 -I/opt/mysql/mysql/include -I/opt/alcatel/logger/include/python2.6 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.6/_mysql.o -g -mt -m32 -xarch=sparc -DHAVE_RWLOCK_T -DUNIV_SOLARIS -DUNIV_SOLARIS
gcc: warning: `-x arch=sparc’ after last input file has no effect
cc1: [...]
Python: abspath, basename, dirname
Wednesday, 6 January 2010
This is a note-to-self post regarding three of Python’s os.path functions, some examples:
>>> os.path.abspath(‘/opt/stuff/things/bin’)
‘/opt/stuff/things/bin’
>>> os.path.abspath(’stuff/things/bin’)
‘/opt/stuff/things/bin’
>>> os.path.basename(‘/opt/stuff/things/bin’)
‘bin’
>>> os.path.dirname(‘/opt/stuff/things/bin’)
‘/opt/stuff/things’
Exaile: Custom Statusbar Plugin
Wednesday, 11 November 2009
I made a plugin for Exaile, that allows customisation of the text in the main window’s statusbar. I wrote it for and tested only against 0.3.1+ which is the current in-development version from bzr. It does NOT work with 0.3.0.2, which is the current stable. Also it requires Python >= 2.6.
Here’s how you check out [...]
Twitter Weekly for 2009-10-24
Saturday, 24 October 2009
RT @IMDb #IMDb turns 19 today. Thank you all. #
got a blinking cursor in firefox and scrolling with the keyboard sucks now? … disable “caret” mode by pressing F7 or via about:config. #
MySQL Python/Connector actually only works with Python >= 2.6, because of extensive use of the “as” keyword. https://launchpad.net/myconnpy #
“Everything will be okay in [...]
Python: easy_install behind proxy under Windows
Tuesday, 14 July 2009
In general you just need to set the HTTP_PROXY environment variable to make easy_install work through a proxy. With Linux you do the using the “export” command and add it to you .bashrc or something. On Windows you can either use the “set” command every time or set the variable permanently in Control Panel – [...]
Firefox vs. Chrome vs. IE8: multiple connections to one HTTP/SCGI/WSGI app
Monday, 13 July 2009
I am currently evaluating ways to run a persistent Python WSGI Webapp using Apache2 or Lighttpd. The idea is to have a daemon running on it’s own doing all the work, that also has an interface towards the webserver.
So I set up Lighttpd as SCGI client and used flup to wrap a simple WSGI app [...]
Oracle & Python
Tuesday, 5 August 2008
The module to access an Oracle database with Python is cx_Oracle. This works for all versions from 8i to 11g. To compile you need to have Oracle libraries, but luckily you do not need the full installation — the “instant client” with OCI is enough. (Thanks for pointing that out in this article.)
When using the [...]

