Python on Android?

Johannes Findeisen mailman at hanez.org
Tue Feb 20 18:33:10 EST 2018


On Wed, 21 Feb 2018 00:11:24 +0100
Johannes Findeisen wrote:

> On Tue, 20 Feb 2018 23:12:23 +1100
> Chris Angelico wrote:
> 
> > On Mon, Feb 19, 2018 at 3:57 AM, Johannes Findeisen <mailman at hanez.org> wrote:  
> > > On Sun, 18 Feb 2018 20:57:02 +1100
> > > Chris Angelico wrote:
> > >    
> > >> Does anyone have experience with running Python scripts on Android
> > >> phones? I have a brother (honestly! I'm not actually using a phone
> > >> myself!) who's trying to run one of my scripts in QPython, which
> > >> claims to be version 3.2.2. I think that really truly is a Python 3.2
> > >> implementation - probing for newer features suggests that it actually
> > >> doesn't even support the u"..." syntax that came (back) in with Python
> > >> 3.3. So... does anyone know of a Python interpreter that's compatible
> > >> with 3.4 or better and runs on Android?
> > >>    
> > >
> > > There is an App for Android called "Pydroid 3". You can find it in
> > > the Google Play Store [0]. It provides a Python interpreter in version
> > > 3.6.2 in its current release.
> > >
> > > The Python binary is installed under
> > >
> > > /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/bin/python
> > >
> > > but I can not access it in a normal terminal without being user "root"
> > > but it is usable from within the terminal included in the Pydroid App.    
> > 
> > Many thanks for all the suggestions. Pydroid is the one that has
> > worked; he's now able to run stuff happily from the terminal. Next
> > step is to create an icon that invokes it, but that's looking rather
> > harder (probably means I'm going to have to learn Kivy, and I already
> > have no shortage of projects...). Everything's working in the terminal
> > (even a read-write $HOME, which we didn't have previously), and I'm
> > pretty happy with that!
> > 
> > All suggestions were read and are appreciated, even though I'm only
> > quoting the one we ended up going with. Thank you Kirill, MRAB, Abdur,
> > and Johannes!  
> 
> You're welcome!
> 
> Take a look at the "Kivy Launcher" App for Android if You don't want to
> do deep learning of Kivy. With this App You can just copy some
> Python code to the Kivy launcher directory "/sdcard/kivy/<YOURAPPNAME>"
> and execute it with just one click without packaging your own APK file.
> 
> Don't know which Python version is included in Kivy Launcher and believe
> it is 2.7. but it think Kivy will go over to Python 3.* in the near
> future.

I forgot the link to the documentation...

https://kivy.org/docs/guide/packaging-android.html#packaging-your-application-for-kivy-launcher

Johannes



More information about the Python-list mailing list