#!/usr/bin/python3
def main():
# define list
l = []
# validate list
assert not len(l)==0, "error: the list is empty"
if __name__ == '__main__':
try:
# display
print("[foo.py] beginning")
# launch function
main()
finally:
# display
print("[foo.py] end")
#!/bin/bash
## definitions
PYTHON="/usr/bin/python3"
## functions
function controlerror {
if [ $1 -eq 0 ]
then
echo "The script ran ok"
#exit 0
else
echo "The script failed" >&2
exit 1
fi
}
# display
echo "[launcher.sh] beginning"
# launch python script
$PYTHON foo.py
# control errors
controlerror $?
# display
echo "[launcher.sh] end"
# end
exit 0