Re: Make a .WAV file come out of the left speaker in Windows

2005-07-18 Thread Alan Green
Alan Green wrote: > I am writing a Python script that uses the win32all winsound package to > play a .wav file. I [need] the sound come out of the left hand speaker, but > not the right hand speaker. I eventually got out ctypes and used it to access the Windows multi-media libraries.

Re: Searching through a list of tuples

2005-07-12 Thread Alan Green
Peter Otten wrote: > Repton wrote: > > > I often find myself storing data in a list of tuples, and I want to ask > > questions like "what is the index of the first tuple whose 3rd element > > is x", or "give me the first tuple whose 2nd element is y". > >>> items = [(1, "a", 10), (2, "b", 20), (3,

Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads'C1, C2 and C3'

2005-07-12 Thread Alan Green
Ric Da Force wrote: > Hi guys, > > Thank you all for your input! It was good to see so much convergence in the > approach! Just for divergence, you can also do this with regular expressions: >>> import re >>> re.sub("(.*),(.*)", r"\1 and\2", "C1, C2, C3") 'C1, C2 and C3' Alan. -- http://mail.

Make a .WAV file come out of the left speaker in Windows

2005-07-11 Thread Alan Green
I am writing a Python script that uses the win32all winsound package to play a .wav file. I the sound come out of the left hand speaker, but not the right hand speaker. I've look at some Python sound libraries (PySonic, Audiere, pygame), as well as any number of command line .wav file players. For