Python for Android

Run python scripts in your smartphone

Hey everybody, today I’m going to teach you how to run Python scripts in Android. Let’s get started.

QPython

QPython is a script engine which runs Python programs on android devices. It also can help developers develop android applications.

Installation

To install QPython and run scripts in your android phone all you have to do is to open Google Play and search for QPython. You will probably see 2 options: one for Python 2 and another for Python 3.

Main page

Once you are done installing the app, you should see something like this:

python for android

If you swipe to the left, you can see the Menu.

python for android

Installing libraries

Installing new libraries may be a little tricky. To do that, open the console in your android phone and type this:

import pip
pip.main(['install', 'numpy'])

Just replace “numpy” with the library you want to install.

Most of the app features are pretty intuitive. They just follow apps conventions, so there is not anything to worry about.

Examples

QPython also includes some examples of how to make your scripts look like a native android app made in python. Those demo codes are a must check.

This was a really short tutorial, but I’m sure this is enough introduction for you to start digging yourself. If you have any question, just leave us a comment and we will help you.


Leave a comment