play a midi file from the interpreter?

Max M maxm at mxm.dk
Mon Aug 30 07:00:14 EDT 2004


Elaine Jackson wrote:
> Could you sketch me a useage example? I'm finding the documentation extremely
> sparse. I've heard of 'pipes', but I don't actually know what they are.

Basically you just pass popen a string that looks like one typed at the 
command prompt:

# untested
# (Eg. I don't know the name of your midi file player
# so I call it playmidifile.exe)

import os
midifilename = 'c:/path/to/midifile.mid'
result = os.popen('playmidifile.exe %s' % midifilename)
print result



More information about the Python-list mailing list