Help - Search - Members - Calendar
Full Version: Python Readline Support
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Python
shula
python 2.3 (from some's cramfs-ed package)
i can't seem to get the console mode interpreter to work with "sepcial keys", ie. arrows, backspace...

i once had it working under sharp rom -> it was pure begginers luck, i guess.


i tried to install libncurses 5.0
i tried to install "readline_4.3_armv5tel.ipk"
tried to copy readline.so + xreadline.so to /usr/lib/python/lib-dynload/
tried to copy readline.py to /usr/lib/python/

any suggestions?

(i know there are python & zaurus developers around - is there a specific forum/website/list they're all hanging at?)
lardman
QUOTE
i tried to install libncurses 5.0
i tried to install "readline_4.3_armv5tel.ipk"


You say "tried"; did it not work?

QUOTE
tried to copy readline.so + xreadline.so to /usr/lib/python/lib-dynload/


I'd copy them to /usr/lib personally.

Don't forget libhistory (is that the right name? :-) which is part of readline iirc.


Si
shula
there is a libhistory somewhere, i'lll try that too
shula
I tried several libraries.. readlines, curses, pythons histories.. all together and apart... i just look now for a python pack that works. even a woodoo script is ok for me. There's quite a python-zaurus-ipk mess around.

Is there a python 2.3.x with working line-history, terminal issues solved etc?
kopsis
My guess is that you're using the Python image that I created for my PyqPlayer project. I went back and checked and sure enough it's not set up to build in the readline support. I'll take a shot at rebuilding it today with readline turned on. Stay tuned smile.gif
shula
thank you,
but i actually refered to "python.cramfs"
which i got at: http://zaurus.xavierxeon.de/zaurus.php?gro...el&topic=python

anyhow,
i aim and try to build a small but featured python package, with these specs:

- ful standard library (incl. "new.py", "UserDict.py", and everything)
- no ".pyc" nor ".pyo" - to save space in case of cramfs or target install
- use only symlinks (the above mentioned cramfs contains actuall libx.so.n.n instead of symlinks :-( that's why it's huge.
- a compressed executable (with "uclx")
- (py) sqlite
- pyQt
- anygui (latest CVS snapshot or so)
- hopeufully - some smart IDE, like "pythonwin"
- functional command line shell :-)
- ?

i target my package to stay on internal storage because i depend on python to do stuff in all circumstances
lardman
There's what appears to be a pretty fully spec'd python in the OZ feed (Mickeyl is a big python fan); however you'd have to use OZ to use it (or recompile it all for the Sharp ROM).

Actually, python my have made it into the opie-on-the-Sharp-ROM feed wherever that is now.


Si
kopsis
Ok, readline support has now been added to my Python for Sharp ROMs. All that's changed is the executable so if you already have the big filesystem image, all you need to do is grab the new ipk and install it (remember to uninstall the old one first ... that won't affect the Python filesystem image).
clofland
Mickeyl has put together a very nice Python package. He compiles it for OZ and for the old GCC 2.95 so us Sharp users can use it. You can find it here

http://www.vanille.de/feed/python/armv4l-gcc2.95/

You just have to use the newipkg installer to install the packages I think.

However, Python 2.4 is coming out, and SQLITE has come up with a new database format that I think will require a new version of pyqt.

So it is getting close to time for a new build of Python. I don't know if Mickeyl will build us one or not. He certainly has plenty of other work to do.

(I still wish we didn't have to have so many different, and somewhat incompatible OS's on such a small device. smile.gif )
kopsis
QUOTE(lardman @ Nov 24 2004, 07:06 AM)
Actually, python my have made it into the opie-on-the-Sharp-ROM feed wherever that is now.

Python for ARM Linux has an older set of (I presume Mickeyl's) Python packages built for the Sharp ROM. They're a little out of date and not 100% complete, but I was using them successfully on a C760 with Cacko 1.21a for a while.

However when I tried to get MoinMoin running I found there were a few Python bits that just weren't available in any of the existing Sharp ROM packages. On top of that, to use them on a Sharp ROM you have to either install to internal memory or use symlinks to an ext2/3 formatted memory card. I wanted it to be extremely easy for non-Python-non-Linux-experts to get a fairly complete Python installation running off any memory card (including FAT formats), so I did my own build and packaged it up into a loop mountable ext2 filesystem plus an ipk that sets everything up. Once I know it's stable and complete, I'll do a cramfs/squashfs version that should theoretically get it down to about 10MB.
clofland
I am downloading your Python Z Image now Kopsis, it sounds very cool.
kopsis
Do let me know if you find any problems or have suggestions for improvements. I'm still a relative newbie when it comes to Python development smile.gif

Pyqt is such a quick and easy way to develop Zaurus apps! I'm hoping a readily availability, easy to use, Sharp ROM compatible Python will lower the bar for casual developers who have ideas for Zaurus apps but don't want to deal with cross-development, setting up an onboard arm-gcc toolchain, or the limitations of the various JVMs for the Zaurus.
clofland
It seems to work very well!

BTW, if anyone needs an "IDE," consider trying VisiScript (google for it).

I wonder what needs to be done to get SQLite version 3 support on the Z.

I know a sqlite package and a pysqlite extensions package are both needed. I've done some digging, but I haven't found a sqlite 3 package for the Z yet.
kopsis
QUOTE(clofland @ Nov 24 2004, 10:12 AM)
I wonder what needs to be done to get SQLite version 3 support on the Z.

I had no trouble building SQLite 2.x and pysqlite so I'll take a shot at 3.0.8. Stay tuned ...
kopsis
SQLite3 was easy smile.gif All ipk'd up and ready to go. See this post for a download link.

Now I have to take a look at pysqlite. That may not be as simple since I'm not sure that 2.x and 3.x versions can co-exist as easily as the libraries can.
fpp
QUOTE(kopsis @ Nov 24 2004, 08:51 AM)
Do let me know if you find any problems or have suggestions for improvements. I'm still a relative newbie when it comes to Python development smile.gif

David, newbie or not, you are a hero ! Thanks a lot for this !

I agree with you that trimmed-down Python distributions (for size reasons) are a hassle. Except for code you create yourself, everything else is bound to have problems.

Lately I have been wanting to use some existing apps on my Z, and mostly failing because there was always something missing. In particular, the new DateTime module is not present in either Riverbanks's discontinued 2.3.3 port, or Mickeyl's arm-python. And it's a binary module too, so you can't just grab a .py file from your desktop install and copy it over...

I was just about to call for help here on this issue, only to find out you'd solved it for us -- twice actually : a complete Python/PyQt distribution AND CF/SD install.

Heartfelt thanks !

QUOTE
Pyqt is such a quick and easy way to develop Zaurus apps! I'm hoping a readily availability, easy to use, Sharp ROM compatible Python will lower the bar for casual developers who have ideas for Zaurus apps but don't want to deal with cross-development, setting up an onboard arm-gcc toolchain, or the limitations of the various JVMs for the Zaurus.


I've no experience with Qt/PyQt (only dabbled in wxPython for GUIs), but the Z is a good motivation to try it out, and your work will certainly help.

Otherwise, for apps that are not too interface-heavy, another way to meet those goals you set above is to use some of the many excellent Python tools available and create Web apps...
kopsis
... and here's pysqlite 1.1.5 for SQLite 3.x (if you want the 2.0.alpha1 stuff, you're on your own). This is built specifically for my ext2 Zaurus Python image, so if you're using somebody else's Python build, this may or may not be useful to you.

To install:
  • Make sure the Zaurus Python image is correctly mounted at /usr/local/lib/python2.3
  • Copy pysqlite3.tgz to /usr/local/lib/python2.3/site-packages
  • cd /usr/local/lib/python2.3/site-packages
  • gunzip -c pysqlite3.tgz | tar xf -
Note that this will blow away Python support for SQLite 2.x databases so it's an all-or-nothing proposition. There is a technique for converting 2.x databases to 3.0 documented on the SQLite website.

I'm going to experiment with this a bit over the long weekend and decide if all this is stable enought to permanently switch the SQLite 2.x support in my Python Image to SQLite 3.x.
shula
wow! i didnt imagine my question will lead to all this
great! i'll try every tip and ipk given here :-)

so here's my 2 cent - PyQt tip:
i've been able to get a free version of PyQT gui builder for window$,
plus all kinds of libraries etc. i build the gui there,
and use it on the Z.
kopsis
From small acorns the mighty oaks grow wink.gif I've petitioned the "powers that be" for a dedicated Zaurus Python forum under "Everything Development" ... we'll see what happens.

What's the name of the GUI builder you're using? Do you have a download link?
shula
it's Qt Designer , of course, and i think it's part of blackadder.
link? i doubt i'll be able to find all the components again :-(

anyway, if you happen get into installation troubles, contact me.
i didn't look into a linux version, since i dont have linux desktop installed.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.