[Sidefx-houdini-list] call opparm from outside houdini

Luca Zappala luca at cinesite.co.uk
Tue May 1 12:57:16 EDT 2007


The issue was not in the pipe (as I originally thought) but in the node 
and param variables.
Now it's all solved.
thanks Ammon Francois and you all.
Luca

Ammon Riley wrote:
>> I'm referring to python script. Is there a reason why I should promote
>> "opparm -c %s cache_execute\n" % object instead of strings operations?
>
> No -- it's just a question of personal taste. I find the former more
> readable than sprinkling plus signs and quotes in the code:
>
>    command = "opparm -c %s %s" % (node, param)
>
> vs
>
>    command = "opparm -c" + node + " " + param + "\n"
>
> I find perl's string interpolation even more readable:
>
>    $command = "opparm -c $node $param";
>
> but to get something similar in python (I think), you have to go
> with the Template class:
>
>    http://docs.python.org/lib/node40.html
>
>> This is the current script (not working):
>> command = "opparm -c "+node+" "+param+"\n"
>> phpscript = os.popen("hscript ........../filename.hip","w")
>> phpscript.write(command)
>
> Well, without seeing complete code, the only thing I can suggest is to
> see if the command is being built okay:
>
>    command = "opparm -c "+node+" "+param+"\n"
>    print command
>
> If the command that gets printed is what you expect, then the problem
> is somewhere in the pipe. Maybe the popen failed?
>
> You should be more explicit about "not working". That's pretty vague,
> and there could be a lot of reasons why something "isn't working". If
> there is an error message, what is it? Can you distill the problem down
> into a short, self-contained snippet of code that exhibits the same
> behaviour? What's it doing that you're not expecting, or, conversely,
> what's it *not* doing that you're expecting it should?
>
> Cheers,
> Ammon
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>




More information about the Sidefx-houdini-list mailing list