07-29-2014, 06:30 PM | #1 |
Pain in the arse
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Python 3 (and Cython) on Kobo
Since I'm using python for creating a little program for kobo, I'll post here this package, for anyone interested.
It contains the python 3.4.1 libraries, the interpreter and a limited subset of the standard library. For this reason the package is very small (~6 Mb unpacked). I don't create a separate package for python anymore. If you want to install it, you have simply to get the Kobo Installer: https://www.mobileread.com/forums/sho...55&postcount=1 Not all modules are included, since the size is too much for our poor little Kobo. You can find all the other modules here: https://www.mobileread.com/forums/sho...14&postcount=6 Last edited by Lucas Malor; 08-26-2014 at 06:01 AM. Reason: cleaned up info |
07-30-2014, 08:30 PM | #2 |
Pain in the arse
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I updated the package, I added also the interpreter. Maybe it's more useful to be able to create a python script and launch it with the usual "python3 script.py", I suppose.
|
Advert | |
|
07-31-2014, 03:44 AM | #3 |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Thank you! I think this should be much more appealing for most users than your first package. I am not a python user myself (maybe not yet), but I think I should probably update the Kobo Start Menu so that one can easily launch python scripts.
|
07-31-2014, 06:03 PM | #4 |
Pain in the arse
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Python is fantastic for that stuff (also). Bash scripting is quite tedious!
Last edited by Lucas Malor; 07-31-2014 at 06:06 PM. |
08-14-2014, 01:28 PM | #5 |
Pain in the arse
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I added a bunch of modules to the package, including:
sqlite3 tarfile bz2 re time datetime math collections shutil fnmatch copy string logging traceback atexit pickle mmap fcntl array Since I'm using Python extensively in Kobo Installer, you can install them together. I'm no more interested to create a separate package. Last edited by Lucas Malor; 08-14-2014 at 01:42 PM. |
Advert | |
|
08-14-2014, 02:31 PM | #6 |
Pain in the arse
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I add also all the modules, pyc compiled. I suggest you to add only the modules you need. You can sideload the entire package, but this way the python installation will levitate to more than 20 Mb (note that you have only 100 Mb free on your root partition).
|
08-19-2014, 12:12 PM | #7 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
|
This is a great project! expanding functions with programming.
I am green hands. May you give me some detail tips about telnet Kobo? Thank you! |
08-19-2014, 12:57 PM | #8 | |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Quote:
|
|
08-19-2014, 09:15 PM | #9 | |
Enthusiast
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
|
Quote:
Thank you, tshering. I hear of you are going to build a Web Browser, it is so fantastic! I have a question, may Kobo support GTK+ lib so it is possible to transplant Kindle's softwares. |
|
08-19-2014, 10:13 PM | #10 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The problem here is that it's Python 3. It should be Python 2.7. Python 3 is a mistake. It's incompatible and most code written for Python 2.x will not be ported as it's not worth the effort. Python 3 should be Python 2.x compatible.
Last edited by JSWolf; 08-19-2014 at 10:22 PM. |
08-20-2014, 04:23 AM | #12 |
Pain in the arse
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
@jswolf: in my humble opinion it worth the effort enough. py3 is much more powerful and easy to use and have features like generators and new formatting minilanguage that I find impossible to renounce now. On the other hand py2 is full of deprecated features, incompatible behavours and convoluted unicode support.
The majority of the translation works is done by the 2to3 tool. Furthermore you can slightly move to the py3 code using from future import blablabla @haugor: what OS do you have and where the error comes up? I don't know if gtk needs an X. Kobo devices use Qt and no X. |
08-20-2014, 07:54 AM | #13 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
|
I use Kobo firmware 2.8.1
after I click the 'usbnet' button. Kobo echo 'usb network error' in a QT dialog box. I ask about the GTK because Kindle has a Terminal Emulator based on GTK, I hope Kobo can use it. Thank you for reply! Last edited by Haugor; 08-20-2014 at 07:57 AM. |
08-20-2014, 12:12 PM | #14 |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
|
08-21-2014, 12:26 AM | #15 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Aug 2014
Device: Kobo Touch C、KPW3
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Python for Kobo Firmware 2.6+ | KevinShort | Kobo Developer's Corner | 39 | 12-31-2017 01:38 PM |
Touch Python/Pygame successfully running on Kobo Touch | KevinShort | Kobo Developer's Corner | 18 | 10-24-2012 03:08 PM |
What is python | The Terminator | General Discussions | 20 | 01-21-2011 12:58 PM |
python command line tool for kobo | reed | Kobo Reader | 2 | 06-05-2010 02:07 AM |
Python 2.5 or 2.6? | itimpi | Calibre | 5 | 01-19-2009 12:48 PM |