I worked out the solution by going to the Python-for-Android (Py4A) home and found the script that allows Python3 to run as a "Stand alone" on Android.
There are 3 ways to do this:
I created the "standalone.sh" script, saved it at "HOME"(export HOME=/data/data/com.spartacusrex.spartacuside/files
),
changed its mode to executable, called it and python appeared.
I opened the ~/.bashrc and pasted copied in the code:
export EXTERNAL_STORAGE=/mnt/sdcard/com.googlecode.python3forandroid
export PY34A=/data/data/com.googlecode.python3forandroid/files/python3
export PY4A_EXTRAS=$EXTERNAL_STORAGE/extras
PYTHONPATH=$EXTERNAL_STORAGE/extras/python3
PYTHONPATH=${PYTHONPATH}:$PY34A/lib/python3.2/lib-dynload
export PYTHONPATH
export TEMP=$EXTERNAL_STORAGE/extras/python3/tmp
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=$PY34A
export LD_LIBRARY_PATH=$PY34A/lib
$PYTHONHOME/bin/python3 "$@"
Note that this means every time you launch Terminal IDE, you will automatically load Python and find yourself at the Python prompt.
- To launch Python the normal way, like shown by Lanky Cyril, paste the following code in the .bashrc:
export EXTERNAL_STORAGE=/mnt/sdcard/com.googlecode.python3forandroid
export PY34A=/data/data/com.googlecode.python3forandroid/files/python3
export PY4A_EXTRAS=$EXTERNAL_STORAGE/extras
PYTHONPATH=$EXTERNAL_STORAGE/extras/python3
PYTHONPATH=${PYTHONPATH}:$PY34A/lib/python3.2/lib-dynload
export PYTHONPATH
export TEMP=$EXTERNAL_STORAGE/extras/python3/tmp
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=$PY34A
export LD_LIBRARY_PATH=$PY34A/lib
You will notice that the last line in the second solution has been taken out and put in an executable file "~/python". Here is the code:
#!/system/bin/sh
/data/data/com.googlecode.python3forandroid/files/python3/bin/python3 "$@"
I used the second one so that when I launch Terminal IDE, I get my Python prompt instantly. I installed the third solution so that, should I leave the Python prompt, I have a way to get back in the same terminal session.