Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-26-2016, 12:52 PM   #1
bosito7
Junior Member
bosito7 began at the beginning.
 
bosito7's Avatar
 
Posts: 1
Karma: 10
Join Date: Aug 2016
Device: Kindle 7th generation
Cool Python + PyQt enviroment for Kindle & PaperWhite devices.

Hello every one, I'm new here and this is my first post I hope that you enjoy.

A month ago I got my Kindle touch 7 generation (AKA KT2), since I saw that the device have a python environment I start to seek an PyQt environment to program or port some PyQt aplications whithout results.

For the people who don't know QT if an amazing framework for GUIs an have other tools for networking databases an others and PyQt is a wrapper tho allow use QT in Python.

Then I decided to do it my self, but the task was hard because I did not haven experiences developping for thes devices, after days of study and asking for some people I make the environment work.

Using the PyGTK environment in https://www.mobileread.com/forums/sho...0&postcount=38

I add the Qt librarys an the PyQt librarys from the Debian armel repository, modify the scripts to set up the environment. In the PyQt applications is important to put the magic string in the windows title to see the application.

To install the environment you must have install KUAL launcher, then extract the zip on the extension folder then you will see the menu "PyQt APPs" in KUAL for now this will run a example application in PyQt, if you have installed the kterm in your Kindle thet you can prove the text editor example application ported to Kindle stored in /mnt/us/extension/python/runitPyQt.sh

I did't tied on other devices. If work in others devices please notify us

Autor: Francisco Perdigon Romero (aka bosito7)
Special Thanks for David Boddie (aka dboddie), knc1, blkhawk.

The links for download the environment:
Google Drive: https://drive.google.com/folderview?...zQ&usp=sharing
Dropbox: https://www.dropbox.com/sh/onpn4v2en...xPV5BJpua?dl=0
GitHub (the last updates will be here): https://github.com/bosito7/kindle_Python_PyQt_env

Here some images:


Attached Thumbnails
Click image for larger version

Name:	resized_20160826_123546.jpg
Views:	2481
Size:	5.4 KB
ID:	151191   Click image for larger version

Name:	resized_20160826_123604.jpg
Views:	2399
Size:	23.7 KB
ID:	151192   Click image for larger version

Name:	resized_20160826_123622.jpg
Views:	2411
Size:	24.9 KB
ID:	151193  
bosito7 is offline   Reply With Quote
Old 09-15-2016, 11:23 AM   #2
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
thanks for the work and contribution
zxczxc is offline   Reply With Quote
Old 11-17-2016, 05:15 AM   #3
kdusr
Connoisseur
kdusr began at the beginning.
 
kdusr's Avatar
 
Posts: 77
Karma: 13
Join Date: Oct 2016
Location: Mars
Device: KOA, KV, KOA2,PW4,PW5
QT is most Modern and flexible GUI frame,
user interface is very important, especially on kindle , lot of third part app of kindle has difficult UI ,

e.g leafpad of kindle, hard to select specific txt , hard to page down page up, click several times to open correct menu...
maybe there is way to create better(at least User-friendly interface) app of kindle with pyqt, great job bosito7! thanks alot !

PS > why is pyqt, why not pyside, they are almost same funcation, but pyside is LGPL license, free to use, pyqt not

Last edited by kdusr; 11-17-2016 at 05:28 AM.
kdusr is offline   Reply With Quote
Old 11-17-2016, 07:01 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
Some people, even some entire nations, do not believe in Intellectual Property Rights (except their own).
So asking them to follow the terms of software licenses is a waste of time and bandwidth.

Also, GTK+ is already installed in the factory images.
knc1 is offline   Reply With Quote
Old 11-18-2016, 02:29 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by kdusr View Post
QT is most Modern and flexible GUI frame,
user interface is very important, especially on kindle , lot of third part app of kindle has difficult UI ,

e.g leafpad of kindle, hard to select specific txt , hard to page down page up, click several times to open correct menu...
maybe there is way to create better(at least User-friendly interface) app of kindle with pyqt, great job bosito7! thanks alot !
There are existing text editors that use PyQt, so I don't see why not.

That being said, I don't see why using a different language would inherently make it "better" than Leafpad. You will need to code it to be "better", either way.

Quote:
PS > why is pyqt, why not pyside, they are almost same funcation, but pyside is LGPL license, free to use, pyqt not
What is your definition of freedom? The ability to write proprietary code for Kindle software?

Last I checked, PyQt is GPL, which is the same as LGPL except for the permission to link shared libraries to proprietary code.
eschwartz is offline   Reply With Quote
Old 11-25-2016, 10:15 PM   #6
glibili
Junior Member
glibili began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2013
Device: kindle pw
Hello, I found your python+PyQt compiled by glibc 2.15, but my kindle only has glibc 2.10 so it's not working.

Can you provide your source code and compiling environment so I can recompile it with an older version of gcc.

Thanks!
glibili is offline   Reply With Quote
Old 11-25-2016, 10:36 PM   #7
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 glibili View Post
Hello, I found your python+PyQt compiled by glibc 2.15, but my kindle only has glibc 2.10 so it's not working.

Can you provide your source code and compiling environment so I can recompile it with an older version of gcc.

Thanks!
even easier -
borrow a copy of glibc-2.15 (or newer) from Debian/Jessie/ARMel - add it to the */esys/lib directory.
then patchelf the application's library path to look for it there rather in the usual, reserved system directories.

Linux uses ELF format binaries, ELF systems support the (concurrent) use of multiple system libraries.

See my ARMhf on Kindle thread for a worked example in detail.
(In that case, it was a different version and it was hard float rather than soft float - but the principles are the same).
knc1 is offline   Reply With Quote
Old 11-26-2016, 01:28 AM   #8
glibili
Junior Member
glibili began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2013
Device: kindle pw
Quote:
Originally Posted by knc1 View Post
even easier -
borrow a copy of glibc-2.15 (or newer) from Debian/Jessie/ARMel - add it to the */esys/lib directory.
then patchelf the application's library path to look for it there rather in the usual, reserved system directories.

Linux uses ELF format binaries, ELF systems support the (concurrent) use of multiple system libraries.

See my ARMhf on Kindle thread for a worked example in detail.
(In that case, it was a different version and it was hard float rather than soft float - but the principles are the same).
Hi, I tried your method, but it is still not working. The program complains,

```
ImportError: /lib/libc.so.6: version `GLIBC_2.15` not found (required by /mnt/us/extensions/python/usr/lib/arm-linux-gnueabi/libaudio.so.2)
```

I firstly tried to set LD_LIBRARY_PATH and place 'libc.so.6' extracted from debian/jessie/armeabi under LD_LIBRARY_PATH. But the program still loads 'libc.so.6' from '/lib/libc.so.'6.

Then I used PatchELF to add RUNPATH '.' to 'python2.7', which is the executable, and put libc.so.6 the same directory as 'python2.7'. But it still loads from '/lib/libc.so.6'.

finally I inspected 'libaudio.so.2' with 'readelf -d', but there is no RUNPATH. The command 'ldd python2.7' and 'ldd libaudio.so.2' also gives linkage to '/lib/libc.so.6'.

I really can't figure it out, can you help me please.
glibili is offline   Reply With Quote
Old 11-26-2016, 03:43 AM   #9
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
$ LD_DEBUG=libs <executable name> <args>

And you probably want a runpath relative to $ORIGIN
For a tree like:
MyApp
|
+-- bin
|
+-- lib

set runpath '$ORIGIN/../lib' (the loader will follow that by searching /lib, /usr/lib)
That thing that looks like a shell variable above IS NOT, it is a special flag (including the '$').

No, do not hack LD_LIBRARY_PATH, change the executable (and libraries as required).

Last edited by knc1; 11-26-2016 at 03:51 AM.
knc1 is offline   Reply With Quote
Reply

Tags
developement, developers corner, kindle applications, pyqt, python


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python + PyGTK for Kindle Touch and Paperwhite dos1 Kindle Developer's Corner 25 07-14-2021 09:52 AM
Help with Duokan && Jailbreak on Kindle Paperwhite 5.6.1.0.6 elenderg Amazon Kindle 3 06-10-2015 05:37 PM
Calibre & the New Kindle Paperwhite ehani Library Management 17 02-13-2014 03:51 PM
Calibre & the New Kindle Paperwhite ehani Library Management 1 02-06-2014 04:11 PM


All times are GMT -4. The time now is 06:42 AM.


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