embedding short python scripts inside a bash script
The python interpreter accepts -
on the command line as a synonym for stdin
so you can replace the calls to pyexec with:
python - <<END
See command line reference here.
Why should you need to use -c
? This works for me:
python << END
... code ...
END
without needing anything extra.