Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2014, 07:30 PM   #1
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 623
Karma: 63854
Join Date: Apr 2013
Device: Kobo Glo, 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:
http://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:
http://www.mobileread.com/forums/sho...14&postcount=6

Last edited by Lucas Malor; 08-26-2014 at 07:01 AM. Reason: cleaned up info
Lucas Malor is offline   Reply With Quote
Old 07-30-2014, 09:30 PM   #2
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 623
Karma: 63854
Join Date: Apr 2013
Device: Kobo Glo, 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.
Lucas Malor is offline   Reply With Quote
Old 07-31-2014, 04:44 AM   #3
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,362
Karma: 354062
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by Lucas Malor View Post
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.
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.
tshering is offline   Reply With Quote
Old 07-31-2014, 07:03 PM   #4
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 623
Karma: 63854
Join Date: Apr 2013
Device: Kobo Glo, Kindle 4
Python is fantastic for that stuff (also). Bash scripting is quite tedious!

Last edited by Lucas Malor; 07-31-2014 at 07:06 PM.
Lucas Malor is offline   Reply With Quote
Old 08-14-2014, 02:28 PM   #5
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 623
Karma: 63854
Join Date: Apr 2013
Device: Kobo Glo, 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 02:42 PM.
Lucas Malor is offline   Reply With Quote
Old 08-14-2014, 03:31 PM   #6
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 623
Karma: 63854
Join Date: Apr 2013
Device: Kobo Glo, 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).
Attached Files
File Type: zip python3-modules.zip (5.89 MB, 27 views)
Lucas Malor is offline   Reply With Quote
Old 08-19-2014, 01:12 PM   #7
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 26
Karma: 10
Join Date: Aug 2014
Location: China
Device: Kobo Touch C
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!
Haugor is offline   Reply With Quote
Old 08-19-2014, 01:57 PM   #8
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,362
Karma: 354062
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by Haugor View Post
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!
As a KSM user you might be interested in this post, first spoiler.
tshering is offline   Reply With Quote
Old 08-19-2014, 10:15 PM   #9
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 26
Karma: 10
Join Date: Aug 2014
Location: China
Device: Kobo Touch C
Quote:
Originally Posted by tshering View Post
As a KSM user you might be interested in this post, first spoiler.
aH! I just thought the USBnet function as USB sharing network of ANDROID.

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.

Haugor is offline   Reply With Quote
Old 08-19-2014, 11:13 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,883
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
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 11:22 PM.
JSWolf is online now   Reply With Quote
Old 08-19-2014, 11:16 PM   #11
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 26
Karma: 10
Join Date: Aug 2014
Location: China
Device: Kobo Touch C
Quote:
Originally Posted by tshering View Post
As a KSM user you might be interested in this post, first spoiler.
I tried the USBnet, it just echo 'usb network error'.
What should I do? thank you
Haugor is offline   Reply With Quote
Old 08-20-2014, 05:23 AM   #12
Lucas Malor
Pain in the arse
Lucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughingLucas Malor can shake the floor when laughing
 
Lucas Malor's Avatar
 
Posts: 623
Karma: 63854
Join Date: Apr 2013
Device: Kobo Glo, 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.
Lucas Malor is offline   Reply With Quote
Old 08-20-2014, 08:54 AM   #13
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 26
Karma: 10
Join Date: Aug 2014
Location: China
Device: Kobo Touch C
Quote:
Originally Posted by Lucas Malor View Post
@Lucas Malor
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 08:57 AM.
Haugor is offline   Reply With Quote
Old 08-20-2014, 01:12 PM   #14
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,362
Karma: 354062
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by Haugor View Post
after I click the 'usbnet' button. Kobo echo 'usb network error' in a QT dialog box.
You can try starting usbnet from KSM, rather than from KoboLauncher. I think the problem is that KoboLauncher does not differentiate between the different Kobo Touch versions.
tshering is offline   Reply With Quote
Old 08-21-2014, 01:26 AM   #15
Haugor
Enthusiast
Haugor began at the beginning.
 
Haugor's Avatar
 
Posts: 26
Karma: 10
Join Date: Aug 2014
Location: China
Device: Kobo Touch C
Quote:
Originally Posted by tshering View Post
You can try starting usbnet from KSM, rather than from KoboLauncher. I think the problem is that KoboLauncher does not differentiate between the different Kobo Touch versions.
thank you tshering, I am sorry that I just can not find the usbnet option in KSM.
Haugor is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python for Kobo Firmware 2.6+ KevinShort Kobo Developer's Corner 30 11-14-2014 11:27 PM
Touch Python/Pygame successfully running on Kobo Touch KevinShort Kobo Developer's Corner 18 10-24-2012 04:08 PM
What is python The Terminator General Discussions 20 01-21-2011 01:58 PM
python command line tool for kobo reed Kobo Reader 2 06-05-2010 03:07 AM
Python 2.5 or 2.6? itimpi Calibre 5 01-19-2009 01:48 PM


All times are GMT -4. The time now is 11:44 PM.


MobileRead.com is a privately owned, operated and funded community.