8

I have a script in python. Here is some of my code:

from splinter import Browser
url = "http://arashiyan.ir/Narm/entekhab.html"
browser=Browser('firefox')
browser.visit(url)
second_found = browser.find_by_name("LsnGrp[]")[3]
second_found.fill("3")

I want to run this script in one part of my android application.I researched and find some frameworks like kivy but it will make complete app with python. does it possible with jython? Tnx

Ashkan Rahmani
  • 758
  • 1
  • 8
  • 20
  • I'm not familiar too much with android, but if python is installed, you can try to directly execute that way through java. – Himself12794 Sep 25 '16 at 16:14
  • There's absolutely no reason to run Python in an Android application when you have Java at your disposal. – mwieczorek Sep 25 '16 at 16:16
  • 1
    The actual answer to this question is that you can do this in an otherwise-java app by including python and starting it via JNI. The two best options I'm aware of for this are 1) using kivy's python-for-android build tools to generate the python distribution (you can then start python your own way, or e.g. via a service which is already supported); 2) use the crystrax NDK prebuilt python distributions, which are quite easy to get running and particularly easy to include. If you just want basic python, this is probably the best option. – inclement Sep 26 '16 at 11:20

0 Answers0