Support #5620
closedQuestions on ShellConnector
100%
Description
Hello,
I want to call a script python with
Lavoisier using Lavoisier 4 version as I don't want to
switch to Lavoisier 12 version yet.
I'm trying to use the lavoisier ShellConnector.
I want to execute a python script from a Lavoisier view.
Currently, I manage to use this ShellConnector for a simple script.
But for the script I want to use I get a ERROR CODE 1.
So my first question is what means ERROR CODE 1?
Moreover, I think the problem comes from the way I give arguments to
the script. Below is the way I pass the arguments in my view to the connector.
I have to type of arguments: arguments expecting a value and single arguments.
<parameter name="arguments">
<entry>--a=val</entry>
<entry>--b</entry>
</parameter>
Is this way the good way?
By advance thanks Flavien Forestier
Updated by Reynaud Sylvain almost 11 years ago
- Status changed from New to Resolved
- Assigned To set to Reynaud Sylvain
- % Done changed from 0 to 100
Hi Flavien,
The way you pass the arguments to the script is OK.
The ERROR CODE is the value returned by your python script or your python interpreter. You should get the same value if you enter "echo $?
" just after executing your python script directly from the command line.
By convention, on linux an exit code different from 0 is supposed to be an error. That's why the ShellConnector throws an exception with the exit code value and the sdterr stream in this case.
If your python script is supposed to return a value different from 0 in the normal case, then your should encapsulate it into another script that returns 0.
Regards,
Sylvain
PS: I will remove the tracker "Support" from the forge, in order to have all the questions on the same place: https://forge.in2p3.fr/projects/lavoisier/boards