Python MIDI in 2008

2008-05-06 Thread Maciej Bliziński
For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are from 2003 or 2005. Some packages don't seem to be really used, for instance portmidi doesn't even suppor

urllib2.unquote() vs unicode

2008-03-17 Thread Maciej Bliziński
I've been hit by a urllib2.unquote() issue. Consider the following unit test: import unittest import urllib2 class UnquoteUnitTest(unittest.TestCase): def setUp(self): self.utxt = u'%C4%99' self.stxt = '%C4%99' def testEq(self): self.assertEqual( self.u

Private functions and inheritance

2007-07-16 Thread Maciej Bliziński
Hello, I've come across something that I don't quite understand about Python's inheritance. Consider the following code snippet: class A(object): def call_bar(self): return self.bar() def call___bar(self): return self.__bar() def __bar(self): return "A::__bar()" def bar(self): ret

Adding tuples to a dictionary

2007-05-31 Thread Maciej Bliziński
Hi Pythonistas! I've got a question about storing tuples in a dictionary. First, a small test case which creates a list of dictionaries: import time list_of_dicts = [] keys = [str(x) for x in range(20)] prev_clk = time.clock() for i in range(20): my_dict = {} for key in keys:

Re: Detect current virtual desktop

2006-08-21 Thread Maciej Bliziński
On Mon, 21 Aug 2006 12:52:59 +0200, Harald Karner wrote: > Maciej Bliziński wrote: >> How to detect current virtual desktop in GNOME? How to detect a virtual >> desktop change? >> > Take a look at http://wallpapoz.sourceforge.net/ Harald, many thanks. By the way, I have

Detect current virtual desktop

2006-08-21 Thread Maciej Bliziński
Hello Pythonists, I'd like to write for myself a tiny program that counts time spent on each virtual desktop (in GNOME). In order to do that, I need my program to detect the current virtual desktop. I've googled for it for about one hour and couldn't find any solution. The closest thing I found is