python - TCL parsing a list of arguments to an external call -


im trying execute call python script through aldec riviera-pro

my call python $python_app_name $python_app_args $python_app_args passed single string , not multiple strings resulting in python application sees 1 argument , execution fails.

i've tried think methods pass in various ways same result. need put each argument single variable work?

i tried use array keep getting

can't set "python_string_args(0)": variable isn't array 

my code array assignment looks @ follows

set python_string_args(0) "-gr" set python_string_args(1) "-l" set python_string_args(2) "-r sim" set python_string_args(3) "-t config_arc_cnt_acc.cfg" 

ie have workaround fx assign them each own value or make python application split string components based on argument knowledge.

note python command in riviera-pro calls external python program installed in python/python34 same when executes script command line.

i don't know if tcl interpreter in system recent. if is, should able use

python $python_app_name {*}$python_app_args 

to arguments separate strings. {*} prefix syntactic modifier splices items in list separate arguments. example:

list {b c d} e # -> {a {b c d} e} list {*}{b c d} e # -> {a b c d e} 

the documentation on man page tcl syntax, link below.

in older versions, might work:

eval python $python_app_name $python_app_args 

but might make undesirable adjustments arguments. try printing

puts [concat python $python_app_name $python_app_args] 

to see if looks sensible command line.

you won't able pass array value, arrays don't work way.

documentation: concat, eval, list, puts, {*}


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -