Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 208
Floella Avatar asked Feb 03 '19 13:02

Floella


2 Answers

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.
like image 164
LabGecko Avatar answered Oct 19 '22 10:10

LabGecko


@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.

like image 29
Jay Dangar Avatar answered Oct 19 '22 10:10

Jay Dangar