diff --git a/zUtil_Python/gtPythonCommand.m b/zUtil_Python/gtPythonCommand.m index cc380600376c1399b9dfb858fdebf6616b56e42c..ffd7c657e8ba2f3c287d8b4e28b569630aa4834d 100644 --- a/zUtil_Python/gtPythonCommand.m +++ b/zUtil_Python/gtPythonCommand.m @@ -1,27 +1,32 @@ -function [status, msg, ver] = gtPythonCommand(args, use_fable) -% GTPYTHONCOMMAND Call python witht the proper command +function [status, msg, ver] = gtPythonCommand(args, use_fable, use_exec) +% GTPYTHONCOMMAND Calls python with the proper command % -% [status, msg, ver] = gtPythonCommand(args[, use_fable]) -% ------------------------------------------------------------------------ +% [status, msg, ver] = gtPythonCommand(args, [use_fable], [use_exec]) +% ------------------------------------------------------------------- % INPUT: -% args = <string> Argumants passed to the python invocation -% -% OPTIONAL INPUT: -% use_fable = <logical> Source fable configuration file before {false} +% args = <string> Arguments passed to the python invocation +% use_fable = <logical> Source fable configuration file before {false} +% use_exec = <logical> Use the python command before the script {true} % % OUTPUT: -% status = <int> System command return code -% msg = <string> Python command output +% status = <int> System command return code +% msg = <string> Python command output +% ver = <int> Version of python % -% OPTIONAL OUTPUT: -% ver = <int> Version of python +% Version 002 08-11-2013 by LNervo +% Added option to use or not the python executable % % Version 001 08-02-2013 by YGuilhem + % Default paramater value if ~exist('use_fable', 'var') || isempty(use_fable) use_fable = false; end +if ~exist('use_exec', 'var') || isempty(use_exec) + use_exec = true; +end + pythonExes = {'python', 'python26'}; % Loop over each python executables @@ -51,6 +56,9 @@ if use_fable end % Run command +if ~use_exec + pythonExe = ''; +end [status, msg] = system([fableSet pythonExe ' ' args]); % Add version output if asked