[Tutor] Not getting what execl() should be doing...

Hugo González Monteverde hugonz-lists at h-lab.net
Tue Jun 7 09:52:56 CEST 2005

Hi all,

I'm trying to call up flac's encoder from a Python program. I believe I 
should be doing it ok, but I get completely different results when doing 
it by hand and from the python script. Here's the command line:

$/usr/bin/flac --endian=little --channels=2 --sign=signed --bps=16 
--sample-rate=44100 --delete-input-file /var/data/myfile.raw

This works fine when done by hand, and flac encodes the file.

Inside the script, I do a fork() and then, on the child, I do:

tw_comppath = "/usr/bin/flac"
filepath = "/var/data/myfile.raw"

os.execl(tw_comppath, "--endian=little", "--channels=2", 
"--sign=signed", "--bps=16", "--sample-rate=44100", 
"--delete-input-file", "%s"%filepath)

In this case, the FLAC binary complains about not getting the proper 
options (endian, channels, etc), but it claims it is getting 

What am I doing wrong? I cannot seem to pass the parameters right using 

Thanks for your enlightening....


More information about the Tutor mailing list