Is it possible to run a Python interpreter within a Flutter app?

5,598

Solution 1

TL;DR: Yes, it is possible.  

As there are a number of Python related apps on the Play Store, to include a full port of Python 3, I believe it is definitely possible to run Python on an Android app. The difficulty is in making it happen.

Actually creating that integration is something I am also researching. Resources I have run across so far:

  • Flutter packages - This is the route I am currently attempting, so I cannot help much yet past this list
  • VSCode - Integration here has a learning curve (just like Android Studio) but development seems a little smoother than AS
  • QPython - runs Python on Android devices; no personal experience on this yet
  • BeeWare - again, no personal experience with this
  • Kivy - not an easy integration from my experience; graphics creation is much more involved than native Android development
  • Chaquopy - per the developer, this is still maintained. Supports Java and Python on Android. It does have a supported chaquopy plugin, which is easier to use while integrating with flutter app.

Solution 2

@Floella, I have created chaquopy plugin, by using this plugin, you can use chaquopy sdk in your flutter android app. This is the video I have made that demonstrate the chaquopy plugin in action.

Share:
5,598
Floella
Author by

Floella

Updated on December 09, 2022

Comments

  • Floella
    Floella over 1 year

    I'm new to Flutter and trying it for the first time (I'm not an experienced mobile developer either) and was wondering how to go about running a Python interpreter within my app.

    What I'd actually like to create is an app with Python katas or challenges so that when the user solves a challenge it will tell them if it passed some tests (I assume I'd write those as unit tests).

    Not sure where to start with all of that, though... I'm not even sure Flutter is the best choice, but since it sounds so promising and I can compile my app for both Android and iOS, I decided to give it a go. So any guidance on how to start building this app would be very welcome.