problems with midi programming in python
sreekant
skodela at lithium.com
Wed Jul 5 22:58:23 EDT 2006
Simon Forman wrote:
> Not related to your actual question, but note:
>
>> if len(result) == 0:
>
> empty lists test as False, so this can just be
>
>> if not result:
>
>
>
> and
>
>> result[len(result)-1] -= 128
>
> you can index lists with negative ints, backwards from the end of the
> list, so this can be
>
>> result[-1] -= 128
>
>
> Those are two of my favorite things about python. :-)
>
>
> Peace,
> ~Simon
>
I love python. However, not so shamefully, the above isn't my code. I am
not that good :-(
I scavenged most of the bit shifting code from the net. I am ok with
most of the data structures but bit shifting flies past my head, too far
above.
Ta
sree
More information about the Python-list
mailing list