Hi Peter

Thanks very much for your reply. I have added one more question below.

> The straightforward approach is to pass a list or tuple:
> 
> def build(build_options=()):
>     subprocess_check_call(("make",) + build_options)
> 
> build(("flagA=true", "flagB=true"))

This looks fine - I am trying it.

I would like to display on the console the entire make command, so I have done 
this:

def build(build_options=()):
        make_command = 'make '.join(map(build_options))
        print('Build command: ' + make_command)
        subprocess.check_call(("make",)+build_options)

but I get error:

make_command = 'make '.join(map(build_options))
TypeError: map() must have at least two arguments.

What would be the correct way to concatenate and display the elements in the 
tuple please?

Best regards

David

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to