how to run a C code with argc argv from python?
Question: I need to run my c code from python, usually as adviced
[here](http://stackoverflow.com/questions/4376397/executing-a-c-script-in-
python) I do this and works perfectly:

    
    
    from subprocess import call
    call(["./code", "args", "to", "code"])
    

I would like to run the code that in order to run needs argv, as a number, so
for instance normally from shell I should call simply:

    
    
    ./code #certainNumber
    

I would like to pass a string at the call function, like:

    
    
    D=1
    str = "./code %d"(%D)
    call([str, "args", "to", "code"])
    

obviously this does not work. I would like to chose from python the parameter
that I need to insert in my c code.

thanks


Answer: As twalberg said this works perfectly:

    
    
    call(["./code", str(variableContainingNumber), "other", "args"])
    

