run python 2.x on android 7.1.x

250 Views Asked by At

I have an android TV Box running android 7.1.x, that I want to execute a Python 2.x script.

It seems that Qpython will not install on this device. I Installed Qpython 3

The script I want to run is here: https://github.com/mathsgrinds/ustvnow-iptv-m3u-playlist

When I run this from Qpython 3 , I get

Error Line 76
print csrf
         ^
SyntaxError : invalid syntax

As I understand it Python 2.x code may not run on Python 3.x but not sure this is the only issue.

is there a qpython(2) that will run on android 7.1.x ?

All I want to do is to be able to execute one script.

Thanks

Mark

1

There are 1 best solutions below

0
On

Are you sure QPython won't install? Or does the Play Store just not show it or says it is "not compatible with your device"? I had that happen to me on my tablet (RCA Viking Pro 10") but I was still able to install it by downloading it from a 3rd party site and it works fine.

QPython 3 uses python 3.x syntax so you need to put

print(crsf)

Also pip doesn't seem to work right on QPython 3 so installing those packages that @davedwadrds mentioned will be problematic on that version. Your best bet wpuld be to try to install QPython and the associated python 3.6 updater to allow QPython to use python 3.x features