OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Python => Topic started by: shula on November 22, 2004, 03:30:07 pm

Title: Python Readline Support
Post by: shula on November 22, 2004, 03:30:07 pm
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?)
Title: Python Readline Support
Post by: lardman on November 23, 2004, 05:03:50 am
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
Title: Python Readline Support
Post by: shula on November 23, 2004, 07:46:38 pm
there is a libhistory somewhere, i'lll try that too
Title: Python Readline Support
Post by: shula on November 23, 2004, 09:34:28 pm
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?
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 08:24:49 am
My guess is that you're using the Python image that I created for my PyqPlayer project (http://pyqplayer.sourceforge.net). 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
Title: Python Readline Support
Post by: shula on November 24, 2004, 09:23:56 am
thank you,
but i actually refered to "python.cramfs"
which i got at: http://zaurus.xavierxeon.de/zaurus.php?gro...el&topic=python (http://zaurus.xavierxeon.de/zaurus.php?group=devel&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
Title: Python Readline Support
Post by: lardman on November 24, 2004, 10:06:53 am
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
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 11:01:00 am
Ok, readline support has now been added to my Python for Sharp ROMs (http://pyqplayer.sourceforge.net/cgi-bin/bin/view/Main/PythonZaurusImage). 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 (http://prdownloads.sourceforge.net/pyqplayer/python-exe_0.2_arm.ipk?download) and install it (remember to uninstall the old one first ... that won't affect the Python filesystem image).
Title: Python Readline Support
Post by: clofland on November 24, 2004, 11:06:21 am
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/ (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.  )
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 11:24:05 am
Quote
Actually, python my have made it into the opie-on-the-Sharp-ROM feed wherever that is now.
Python for ARM Linux (http://www.vanille.de/projects/python.spy) 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 (http://pyqplayer.sourceforge.net/cgi-bin/bin/view/Main/PythonZaurusImage) 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.
Title: Python Readline Support
Post by: clofland on November 24, 2004, 11:27:50 am
I am downloading your Python Z Image now Kopsis, it sounds very cool.
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 11:51:29 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

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.
Title: Python Readline Support
Post by: clofland on November 24, 2004, 01:12:55 pm
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.
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 02:43:30 pm
Quote
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 ...
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 03:59:12 pm
SQLite3 was easy  All ipk'd up and ready to go. See this post (https://www.oesf.org/forums/index.php?showtopic=8753&view=findpost&p=53442) 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.
Title: Python Readline Support
Post by: fpp on November 24, 2004, 04:54:57 pm
Quote
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
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...
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 05:09:20 pm
... and here's pysqlite 1.1.5 (http://kopsisengineering.com/pysqlite3.tgz) 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: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.
Title: Python Readline Support
Post by: shula on November 24, 2004, 06:16:37 pm
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.
Title: Python Readline Support
Post by: kopsis on November 24, 2004, 11:25:48 pm
From small acorns the mighty oaks grow  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?
Title: Python Readline Support
Post by: shula on November 25, 2004, 01:19:17 am
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.