If I run the following in a bash shell:
function tempE(){ echo "This is tempE"; } export -f tempE python3 -c "import subprocess as sp; print(sp.run