Extending Python for Series 60


Posted

in

,

This morning Jim pointed me to some extension modules for Series 60 Python by the Personal Distributed Information Store project. While I’m very excited to see Series 60 Python specific releases, you don’t have to go to that much trouble to get a working xml parser. There’s a perfectly good xml parser built right in to Python 2.2.2.

You’ll probably not find this written anywhere obvious, but here’s what works quite well for getting a much more complete Python environment on your Series 60 device:

  1. Grab the Python 2.2.2 source tarball.
  2. tar xzvf or do whatever it takes to decompress the file.
  3. Insert your MMC to a card reader or plug in your taco via USB.
  4. Drag the boatload of .py files and subfolders in lib to E:SYSTEMLIBS (you did install to the MMC, right?) making sure not to overwrite any existing files.
  5. Import xml.dom.minidom or whatever library you need.

I’m sure there are modules that just plain won’t work. Nokia have already included a lot of the basics (thank you thank you thank you for getting urllib working!). If the public release is anything like the pre-release software, the xml parsers and a few other things should work just fine. I spot-cheked a few examples from Dive Into Python on the prerelease and the xml-related stuff worked fine.

Update: In the comments attached to this post, effbot clarifies:

Adding the xml python package won’t help you if you don’t have an XML parser; pyexpat adds exactly that.

Comments

10 responses to “Extending Python for Series 60”

  1. Matt Croydon Avatar

    Comments work now. I’ve got to deal with the url structure and old link style stuff coming in won’t have comments working 🙁

  2. Fredrik Avatar

    Adding the xml python package won’t help you if you don’t have an XML parser; pyexpat adds exactly that.

    (note that Nokia’s samples never use the XML library; instead, they use regular expressions to parse XML…)

  3. Tim Avatar
    Tim

    xmllib has enough of a parser for xmlrpclib to work on the series 60.

  4. Matt Croydon Avatar

    Tim: Yep, I found that out last night too and was rather dissapointed. Parsing HTML with sgmllib works, but so far no luck with xmlrpclib. It might be possible to use the expat parser linked above to make it work.

  5. Fredrik Avatar

    xmlrpclib doesn’t depend on Python’s xml package (it falls back on xmllib if necessary). if you need DOM-like structures but no namespaces, you can use ElementTree with the SimpleXMLTreeBuilder module (which uses xmllib).

  6. Extending Python for Series 60 Avatar
    Extending Python for Series 60
    Extending Python for S…

  7. Don P Avatar
    Don P

    Matt, I’m trying to use pyexpat on my nokia 6600 phone but it dies after looking for the library _weakref extension module.

  8. bowens coach travel

    Extending Python for S…

  9. Payday Loans…

    adding to my bookmarks…

  10. Instant Payday Loan…

    cool design. i like it!