Author Topic: Python Readline Support  (Read 10750 times)

shula

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Python Readline Support
« 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?)
C860, pdaxrom rc8,
with Gnumeric as the perfect PIM :-)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Python Readline Support
« Reply #1 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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

shula

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Python Readline Support
« Reply #2 on: November 23, 2004, 07:46:38 pm »
there is a libhistory somewhere, i'lll try that too
C860, pdaxrom rc8,
with Gnumeric as the perfect PIM :-)

shula

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Python Readline Support
« Reply #3 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?
C860, pdaxrom rc8,
with Gnumeric as the perfect PIM :-)

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Python Readline Support
« Reply #4 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. 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

shula

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Python Readline Support
« Reply #5 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

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
C860, pdaxrom rc8,
with Gnumeric as the perfect PIM :-)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Python Readline Support
« Reply #6 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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Python Readline Support
« Reply #7 on: November 24, 2004, 11:01:00 am »
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

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • http://www.lofland.net/
Python Readline Support
« Reply #8 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/

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.  )
C-760 Last Running pdaXrom 1.1.0beta3
- Sandisk UltraII 1GB SD card - Socket LP CF LAN card - Socket LP CF WLAN card - Socket CF Bluetooth Card Rev H -

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Python Readline Support
« Reply #9 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 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

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • http://www.lofland.net/
Python Readline Support
« Reply #10 on: November 24, 2004, 11:27:50 am »
I am downloading your Python Z Image now Kopsis, it sounds very cool.
C-760 Last Running pdaXrom 1.1.0beta3
- Sandisk UltraII 1GB SD card - Socket LP CF LAN card - Socket LP CF WLAN card - Socket CF Bluetooth Card Rev H -

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Python Readline Support
« Reply #11 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.

clofland

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • http://www.lofland.net/
Python Readline Support
« Reply #12 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.
« Last Edit: November 24, 2004, 01:13:37 pm by clofland »
C-760 Last Running pdaXrom 1.1.0beta3
- Sandisk UltraII 1GB SD card - Socket LP CF LAN card - Socket LP CF WLAN card - Socket CF Bluetooth Card Rev H -

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Python Readline Support
« Reply #13 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 ...

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Python Readline Support
« Reply #14 on: November 24, 2004, 03:59:12 pm »
SQLite3 was easy  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.