.python_wrapper
Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 25 March 2025
Index
Return to Main Contents
 
NAME
python_wrapper - wrap Python3 scripts to ensure python3 startup
 
SYNOPSIS
edrc/bin/pythonscript
->
.python_wrapper
edrc/lib/pythonscript
->
.python_wrapper
 
AVAILABILITY
WA2L/edrc
 
DESCRIPTION
Wrap Python3 scripts to avoid using 
#!/usr/bin/python3
or similar path names in the magic key. This enhances the portability
of WA2L/edrc commands written in Python3 to systems where
python3
is not
installed in the default install locations.
python3
has to be installed in
/usr/bin/,
/bin/,
/sbin/,
/usr/local/bin/
or
/usr/contrib/bin/.
Further
python3
locations can be configured in the optional config file
python_wrapper.cfg.
The Python3 packages/modules bundled with WA2L/edrc that are
installed in 
lib/python/pym/<OS-Id>/<major>.<minor>/
are included in the Python3 path 
(PYTHONPATH)
and the Python3 virtual environment
venv
(VIRTUAL_ENV).
To start a new command thru the
.python_wrapper,
follow the following steps:
- 1.)
 - 
create a symlink to the new command in the
edrc/bin/
or 
edrc/lib/
directory depending on your needs:
[ /opt/edrc/bin ]
[ root@acme001 ][*edrc*/bash]: ln -s .python_wrapper new_cmd 
 - 2.)
 - 
install the Python3 script in the
edrc/lib/python/
directory:
[ /opt/edrc/lib/python ]
[ root@acme001 ][*edrc*/bash]: vi new_cmd
[ /opt/edrc/lib/python ]
[ root@acme001 ][*edrc*/bash]: chmod 644 new_cmd
 
 
OPTIONS
-
 
ENVIRONMENT
-
 
EXIT STATUS
- 101
 - 
shell
(python3)
not found. If 
python3
is installed on the system and you get this error, add
the 
python3
location in the configuration file
python_wrapper.cfg.
 - 102
 - 
the Python3 script to be started that should be
located in 
lib/python/
does not exist.
 - 103
 - 
user calling the command has no permission to access/execute
the called
pythonscript.
 - 107
 - 
the 
.python_wrapper
was called directly.
 
 
FILES
- etc/python_wrapper.cfg
 - 
configuration file for the
.python_wrapper
command.
 - lib/python/
 - 
location of the wrapped Python3 scripts.
This files should have the file permissions
644
to show, that those scripts should not be started
directly.
 - lib/python/pym/<OS-Id>/<python-revision>/
 - 
location of the Python3 packages/modules bundled with WA2L/edrc.
 
 
EXAMPLES
-
 
SEE ALSO
edrcintro(1),
binprobe(1m),
cmdlist(1m),
daemon_wrapper(1),
java_wrapper(1),
ksh_wrapper(1),
lua_wrapper(1),
perl_wrapper(1),
ln(1),
ld(1),
osid(3),
os_wrapper(1),
pip(1),
pip3(1),
python3(1),
pythonenv(3),
pythonversion(3),
python_wrapper.cfg(4)
 
NOTES
-
 
BUGS
-
 
AUTHOR
python_wrapper was developed by Christian Walther. Send suggestions
and bug reports to wa2l@users.sourceforge.net .
 
COPYRIGHT
Copyright © 2025
Christian Walther
This is free software; see
edrc/doc/COPYING
for copying conditions. There is ABSOLUTELY NO WARRANTY; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This document was created by man2html
using the manual pages.
Time: 22:46:43 GMT, April 07, 2025