kuri65536 / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
249 stars 104 forks source link

standalone _python2.sh first line updated #119

Closed gauravssnl closed 8 years ago

gauravssnl commented 8 years ago

standalone_python2.sh updated to run Python easily on Terminal: As Android executes commands after searching from /system/bin directory and not from /bin directory ,the first line of standalone_python2.sh has to be changed from #! /bin/sh to as shown below:

! /system/bin/sh

After this is done and this new edited file is copied to /system/bin directory,then Python can be easily run on Terminal app with this command: standalone_python2.sh you can rename this script to whatever you desire and use that name as command. If you use previous version of standalone _python2.sh file and try to use command: standalone _python2.sh to run Python, you will get error as :No such file Earlier,you had to run Python on Terminal with command like this: sh /system/bin/standalone _python2.sh This command is longer and there are chances of mistake in typing. By using updated version,you can easily run Python now.

kuri65536 commented 8 years ago

Thank you for your detailed explanation!

gauravssnl commented 8 years ago

You are welcome.I am just a beginner.

gauravssnl commented 8 years ago

If you follow my method to run Python inTerminal,then there is no need of installing Sl4A and using it.Just rename that standlone_python2.sh (file permission:777) file in /system/bin to whatever you like ,for example,i rename it to "py",then you can easily use Python in Terminal with this commands: py To run any Python script: py filename.py Thanks.