search for: run_python

Displaying 12 results from an estimated 12 matches for "run_python".

2018 Feb 27
5
[PATCH v2 0/3] v2v: Add -o rhv-upload output mode.
This patch set is still for discussion only. See 3/3 for the current list of problems. However this will upload an image to an oVirt or RHV server, although you must have absolutely the latest snapshot version of 4.2 for it to work. Rich.
2018 Feb 27
0
[PATCH v2 3/3] v2v: Add -o rhv-upload output mode.
...ing a binary called ‘python3’ which runs Python 3." + | python :: rest -> + (* Use shell_command first to check the binary exists. *) + let cmd = sprintf "%s --help >/dev/null 2>&1" (quote python) in + if shell_command cmd = 0 && + run_python ~python python_get_version = ["3"] then ( + debug "rhv-upload: python binary: %s" python; + python + ) + else + loop rest + in + loop ["python3"; "python"] + +(* Parse the -oc URI. *) +let parse_output_conn oc = + let ur...
2018 Feb 22
0
[PATCH 5/5] v2v: Add -o rhv-upload output mode.
...ing a binary called ‘python3’ which runs Python 3." + | python :: rest -> + (* Use shell_command first to check the binary exists. *) + let cmd = sprintf "%s --help >/dev/null 2>&1" (quote python) in + if shell_command cmd = 0 && + run_python ~python python_get_version = ["3"] then ( + debug "rhv-upload: python binary: %s" python; + python + ) + else + loop rest + in + loop ["python3"; "python"] + +(* Parse the -oc URI. *) +let parse_output_conn oc = + let ur...
2018 Feb 22
11
[PATCH 0/5] v2v: Add -o rhv-upload output mode.
The first four patches are straightforward. The final patch adds the -o rhv-upload output mode. It is still spooling into a temporary file because I've had some trouble getting streaming conversions working. There are other problems as outlined in the commit message, so this patch is not ready for upstream but is good for discussion. Also I hit this, which I'm assuming for now will be
2018 Feb 22
2
Re: [PATCH 5/5] v2v: Add -o rhv-upload output mode.
...on3’ which runs Python 3." > + | python :: rest -> > + (* Use shell_command first to check the binary exists. *) > + let cmd = sprintf "%s --help >/dev/null 2>&1" (quote python) in > + if shell_command cmd = 0 && > + run_python ~python python_get_version = ["3"] then ( > + debug "rhv-upload: python binary: %s" python; > + python > + ) > + else > + loop rest > + in > + loop ["python3"; "python"] > + > +(* Parse the -oc...
2009 Mar 08
0
[RFC] running octave, python from within R
...will interface shogun to octave,r,python,matlab. It provides commands to run code in foreign languages: Example: library(elwms) A=matrix(c(1.0,2,3, 4,5,6), nrow = 2, ncol=3) B=matrix(c(1.0,1,1, 0,0,0), nrow = 2, ncol=3) pythoncode=sprintf('import numpy\nresults=tuple([A+B])'); elwms('run_python', 'pythoncode', 'print "hi"') C=elwms('run_python', 'A',A, 'B',B, 'pythoncode', pythoncode) D=elwms('run_python', 'A',A+1, 'B',B*2, 'pythoncode', pythoncode) pythoncode=sprintf('import numpy\nresults=(...
2018 Feb 28
1
Re: [PATCH v2 2/3] v2v: utils: Add utility functions for running external Python code.
...> 2 files changed, 34 insertions(+) > > diff --git a/v2v/utils.ml b/v2v/utils.ml > index 1ceba94cd..bf4106620 100644 > --- a/v2v/utils.ml > +++ b/v2v/utils.ml > @@ -196,3 +196,26 @@ let find_file_in_tar tar filename = > ) > in > loop lines > + > +let run_python ?(python = "python") code = > + (* In debug mode output the python code into the log. *) > + debug "running python code using ‘%s’:\n%s" python code; > + > + (* Write the Python code to a temporary file so we don't have to > + * quote things. > + *)...
2013 Apr 09
2
[PATCH 1/2] add run_shell helper
The new run_shell helper is a copy of run_python, and will be used by upcoming changes. Signed-off-by: Olaf Hering <olaf at aepfle.de> --- src/supermin_utils.ml | 9 +++++++++ src/supermin_utils.mli | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/supermin_utils.ml b/src/supermin_utils.ml index f98e09a..cb8a27e 100644 --- a...
2018 Feb 27
0
[PATCH v2 2/3] v2v: utils: Add utility functions for running external Python code.
...23 +++++++++++++++++++++++ v2v/utils.mli | 11 +++++++++++ 2 files changed, 34 insertions(+) diff --git a/v2v/utils.ml b/v2v/utils.ml index 1ceba94cd..bf4106620 100644 --- a/v2v/utils.ml +++ b/v2v/utils.ml @@ -196,3 +196,26 @@ let find_file_in_tar tar filename = ) in loop lines + +let run_python ?(python = "python") code = + (* In debug mode output the python code into the log. *) + debug "running python code using ‘%s’:\n%s" python code; + + (* Write the Python code to a temporary file so we don't have to + * quote things. + *) + let filename, chan = Filena...
2018 Mar 01
7
[PATCH v3 0/6] v2v: Add -o rhv-upload output mode.
v2 -> v3: - Lots of code cleanups. - Documentation. However this is still spooling the file into a temporary before the upload. It turns out that fixing this is going to require a small change to qemu. Rich.
2016 Feb 18
4
[PATCH 0/3] supermin: miscellaneous cleanups
Hi, few cleanups in the supermin codebase; no actual functional change. Thanks, -- Pino Toscano (3): ext2: simplify tracking of visited modules utils: remove unused run_python function Add and use an helper error function src/build.ml | 20 +++++----------- src/dpkg.ml | 4 +--- src/ext2_initrd.ml | 10 ++++---- src/kernel.ml | 27 ++++++++++------------ src/package_handler.ml | 7 +++--- src/pacman.ml | 6 ++--- src/prep...
2014 Feb 25
2
[PATCH supermin v4] Supermin 5 rewrite.
...cmd = sprintf "sh -c %s arg0 %s" - (Filename.quote code) - (String.concat " " (List.map Filename.quote args)) in - if Sys.command cmd <> 0 then ( - eprintf "supermin: external shell program failed, see earlier error messages\n"; - exit 1 - ) - -let run_python code args = - let cmd = sprintf "python -c %s %s" - (Filename.quote code) - (String.concat " " (List.map Filename.quote args)) in - if Sys.command cmd <> 0 then ( - eprintf "supermin: external python program failed, see earlier error messages\n"; -...