[Tutor] lists

Kent Johnson kent37 at tds.net
Tue Jan 20 19:57:14 CET 2009


On Tue, Jan 20, 2009 at 1:02 PM, Norman Khine <norman at khine.net> wrote:
> Hi,
> actually what I was trying to do carries from my last post, where my media
> files are a list that I want to add to the
>
> subprocess.call(['sox', ', '.join(media_list), 'list.wav'])

OK, you want a list, not a string. You can use + to concatenate lists:

['sox'] + media_list + ['list.wav']

or
args = ['sox']
args.extend(media_list)
args.add('list.wav')

Kent


More information about the Tutor mailing list