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

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-26-2012, 08:11 PM   #1
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
Smile Python + PyGTK for Kindle Touch and Paperwhite

Hi,

I couldn't find already packaged PyGTK for Kindle, so I decided to do it on my own. And I've just got PyGTK running on my Paperwhite.

I've used latest Debian sid armel packages. There is GTK+ provided (and few others) despite of Kindle having its own version - I was too lazy to recompile everything to fix missing symbols issues.

All symlinks and hard links in package are dereferenced, which means that it can be safely unpacked on /mnt/us, but it also means that there are copies instead of links and they take more space.

Download: http://dosowisko.net/kindle/python.tar.gz

Usage:

Unpack python.tar.gz package in /mnt/us/extensions (or if you're in USB disk mode - in /extensions). If you really want to, you can place it somewhere else, but you'll need to tweak paths in pythonenv file.

You can setup environment with ". pythonenv" command. After that you can just call "python", or run python files just like any other executable. There are test files bundled - type "python demos/gtk-test.py" to run one.

(please note that windows have to have proper X11 class names in order to be correctly displayed by Awesome - refer to https://www.mobileread.com/forums/sho...hp?t=162022#10 for more info)

It probably won't work on any other Kindle than Paperwhite, but you can still try (update: thanks to twobob we now know that it works on Touch too )

Cheers

Last edited by dos1; 10-27-2012 at 05:07 PM.
dos1 is offline   Reply With Quote
Old 10-26-2012, 10:37 PM   #2
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Kindle 5.

result okay

I DID have to move my previous install of python out of the path.

note to others:
If you get...
Quote:
[root@kindle python]# ./test.py
Traceback (most recent call last):
File "./test.py", line 5, in <module>
import pygtk
ImportError: No module named pygtk
(you probably already have a python install.)
[root@kindle python]# strace -fF -o /mnt/us/pyGTKstrace.txt ./test.py revealed my other ones location.

Code:
5451  getuid32()                        = 0
5451  execve("/mnt/us/usr/bin/python", ["python", "./test.py"], [/* 25 vars */]) = 0
5451  brk(0)                            = 0x11000
A quick mv to another name or unpathed folder will fix that up.

Thanks for the funky toy

EDIT:

I also amended the pythonenv to be a bit more forgiving since we are sourcing it to the main shell.

(with whitespace for clarity, obviously make it valid)

Quote:
#!/bin/sh
export PYTHONPATH=/mnt/us/extensions/python/usr/lib/python2.7/

export LD_LIBRARY_PATH=/mnt/us/extensions/python/usr/lib:\
/mnt/us/extensions/python/usr/lib/arm-linux-gnueabi:\
/mnt/us/extensions/python/lib/arm-linux-gnueabi:\
$LD_LIBRARY_PATH

export PATH=/mnt/us/extensions/python/usr/bin/:$PATH
(if it had pre-pended the $path initially it would have overridden my less local python)
Attached Thumbnails
Click image for larger version

Name:	TightVNC: kindle:0.0_296.png
Views:	1695
Size:	31.0 KB
ID:	94987   Click image for larger version

Name:	TightVNC: kindle:0.0_299.png
Views:	1229
Size:	28.8 KB
ID:	94988   Click image for larger version

Name:	TightVNC: kindle:0.0_297.png
Views:	1091
Size:	13.4 KB
ID:	94989  

Last edited by twobob; 10-26-2012 at 10:57 PM. Reason: pythonenv
twobob is offline   Reply With Quote
Old 10-27-2012, 07:44 AM   #3
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
Quote:
Originally Posted by twobob View Post
Kindle 5.

result okay
Yay! Updated topic name to reflect it (update: didn't work I guess only mods can do that.)

Quote:
Originally Posted by twobob View Post
I also amended the pythonenv to be a bit more forgiving since we are sourcing it to the main shell.
Thanks, I've updated package to contain your changes
dos1 is offline   Reply With Quote
Old 10-27-2012, 08:54 AM   #4
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by dos1 View Post
Yay! Updated topic name to reflect it (update: didn't work I guess only mods can do that.)



Thanks, I've updated package to contain your changes
The way to do that, is to navigate to your first post of the thread, use the "report post" button, request in the text box for the name change.
knc1 is offline   Reply With Quote
Old 10-27-2012, 10:45 AM   #5
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
PyWebKitGtk? Does this support glade?
Those two would be a dream, as I could have quiet a few apps ported...
aditya3098 is offline   Reply With Quote
Old 10-27-2012, 05:06 PM   #6
dos1
20% cooler.
dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.dos1 ought to be getting tired of karma fortunes by now.
 
dos1's Avatar
 
Posts: 93
Karma: 364674
Join Date: Oct 2012
Location: Poznań, Poland
Device: Kindle Paperwhite 1
I've just uploaded updated version with python-glade included, enjoy

Unfortunately, PyWebkitGTK is a bit problematic. Package with it takes much more space (about 50MB unpacked without, and about 150MB with webkit) and programs using it segfault as soon as some page is loaded. It's not included in the package, buuuut...

...I've created python script for creating Python package for Kindle You can specify which Debian packages you want to have included and generate such package by yourself - so if you want to test and/or debug webkit, you can use it. I've already listed all needed dependencies in the script, so you just have to uncomment proper line.

Script is available at http://dosowisko.net/kindle/build-python.py
(it needs unix-like userspace, so on Windows you'll need something like Cygwin)

TODO list:
- integrate on-screen keyboard with PyGTK
- menus don't work, probably Awesome configuration is breaking them somehow
- investigate why webkit segfaults

Last edited by dos1; 10-27-2012 at 05:10 PM.
dos1 is offline   Reply With Quote
Old 10-27-2012, 10:24 PM   #7
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
Nice! I could do without webkit for now. Am working on an mplayer gui. I hope I can finish it this time
aditya3098 is offline   Reply With Quote
Old 01-06-2013, 08:57 PM   #8
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by aditya3098 View Post
Nice! I could do without webkit for now. Am working on an mplayer gui. I hope I can finish it this time
well did you ever get this done?

I could use a few tips...
twobob is offline   Reply With Quote
Old 01-07-2013, 05:09 AM   #9
aditya3098
Guru
aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.aditya3098 ought to be getting tired of karma fortunes by now.
 
Posts: 608
Karma: 1588610
Join Date: Jan 2012
Device: Kindle Scribe
It will be finished, but right now, I don't get much time for anything (exams)
aditya3098 is offline   Reply With Quote
Old 03-23-2013, 03:40 PM   #10
briant1234
Enthusiast
briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.
 
Posts: 39
Karma: 132550
Join Date: Aug 2012
Device: Kindle Touch
Could anyone tell me how to use this? i extracted python.tar.gz to the extensions folder on my KT, but how do i use it on the kindle? (for reference, the file in the extensions folder is python.tar)
briant1234 is offline   Reply With Quote
Old 03-23-2013, 04:12 PM   #11
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
right...

need to untar that also mate

are you a windows user then?
twobob is offline   Reply With Quote
Old 03-24-2013, 12:06 PM   #12
briant1234
Enthusiast
briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.
 
Posts: 39
Karma: 132550
Join Date: Aug 2012
Device: Kindle Touch
ahh, yes a windows user ;D i did un-tar it, and put it in extensions, but then nothing Oo
briant1234 is offline   Reply With Quote
Old 03-24-2013, 09:39 PM   #13
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
well. what did you expect it do?

Did you build something from the demos folder and run it?

need more info as to YOUR actual steps... it does "nothing" on its own...
twobob is offline   Reply With Quote
Old 03-25-2013, 10:40 PM   #14
briant1234
Enthusiast
briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.briant1234 substituted for the Southern Oracle when it was on vacation.
 
Posts: 39
Karma: 132550
Join Date: Aug 2012
Device: Kindle Touch
hmmm maybe ive got this all wrong. i was sort of expecting a app where i could run py files? or possible make/edit them? im sorry im bad at this
briant1234 is offline   Reply With Quote
Old 03-25-2013, 10:45 PM   #15
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
no worries mate. I did much the same..

like I said in https://www.mobileread.com/forums/sho...52&postcount=2

look for the test.py in the subfolder (it's in there) that will get you started. you can check my notes.

: )

We all start somewhere.
twobob is offline   Reply With Quote
Reply

Tags
gtk, k5 tools, kindle, paperwhite, pw tools, pygtk, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Paperwhite Marc_liest Amazon Kindle 360 01-17-2014 05:24 AM
Python for kindle Matan Kindle Developer's Corner 8 01-04-2013 01:54 PM
Amazon launches Kindle Paperwhite and Kindle Lending Library in Europe HarryT News 18 10-13-2012 10:24 AM
Python + pyGTK package for the DR v3.0 Mr. X iRex 22 03-19-2012 05:49 AM
iLiad pyGTK rudysplif iRex Developer's Corner 2 12-23-2007 06:29 AM


All times are GMT -4. The time now is 07:21 PM.


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