def python2(script, args="", **kwargs): """Execute specified script using python2, and python if python2 does not exist. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script.""" return SoS_ExecuteScript(script, ["python2", "python2.7", "python"], ".py", args).run(**kwargs)
def python3(script, args='', **kwargs): '''Execute specified script using python3, and python if python3 does not exist. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script.''' return SoS_ExecuteScript(script, ['python3', 'python'], '.py', args).run(**kwargs)
def julia(script, args="", **kwargs): """Execute specified Julia script with command julia. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script. """ return SoS_ExecuteScript(script, "julia", ".jl", args).run(**kwargs)
def node(script, args='', **kwargs): '''Execute specified script with command node. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script. ''' return SoS_ExecuteScript( script, 'node', '.js', args).run(**kwargs)
def octave(script, args="", **kwargs): """Execute specified script with command Matlab, with default options "-nodisplay -r". This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script. """ return SoS_ExecuteScript(script, "octave", ".m", args).run(**kwargs)
def matlab(script, args='''-nojvm -nodisplay -nosplash -nodesktop -r "try, run('{filename}'), catch me, fprintf('%s / %s\\n',me.identifier,me.message), exit(1), end, exit(0);"''', **kwargs): '''Execute specified script with command Matlab, with default options "-nojvm -nodisplay -nosplash -nodesktop -r". This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script. ''' return SoS_ExecuteScript( script, 'matlab', '.m', args).run(**kwargs)
def R(script, args='', **kwargs): '''Execute specified script with command Rscript, with default options "--default-packages=datasets,methods,utils,stats,grDevices,graphics". This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script. ''' # > getOption('defaultPackages') # [1] "datasets" "utils" "grDevices" "graphics" "stats" "methods" return SoS_ExecuteScript(script, 'Rscript', '.R', args).run(**kwargs)
def ruby(script, args="", **kwargs): """Execute specified script using ruby. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script.""" return SoS_ExecuteScript(script, "ruby", ".rb", args).run(**kwargs)
def bash(script, args='', **kwargs): '''Execute specified script using bash. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script.''' return SoS_ExecuteScript(script, ['/bin/bash', 'bash'], '.sh', args).run(**kwargs)
def python(script, args='', **kwargs): '''Execute specified script using python (which can be python 2 or 3 depending on system configuration. This action accepts common action arguments such as input, active, workdir, docker_image and args. In particular, content of one or more files specified by option input would be prepended before the specified script.''' return SoS_ExecuteScript(script, 'python', '.py', args).run(**kwargs)