0

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

user178167
  • 43
  • 2
  • 7
  • I don't know anything about qpython and its relation to android 7.1.x, but have you considered using python's `six` (https://pythonhosted.org/six/) library, or, if you can edit that one script's source code import `__future__`'s `print_function`, or convert the `print` 2.x syntax error to 3.x's `print()` syntax. Indeed you are "not sure this is the only issue." but with that considerably small script, it may be a way to get the script to execute without concerns of qpython & android compatibilty. otherwise, i've no idea about qpython(2) -> android 7.1.x. – chickity china chinese chicken May 16 '18 at 20:05

1 Answers1

0

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