Category: Python

  • Just Browsing: Books that Caught my Eye

    As a break from classwork last night my wife and I headed to the local Borders to do a little book browsing. I didn’t pick anything up, but several titles caught my eye. Here are the books that I would have picked up if money were no issue and there were a few extra hours in each day:

    • Novell Certified Linux Engineer (Novell CLE) Study Guide: I almost went for a cert with the previous SUSE cert system. I also remembered that I’m a Java Certifieid Programmer and would do more Java certs if I had the time. I really wish that there were a J2ME cert book out there that I could study in my downtime.
    • Secure Architectures with OpenBSD: This looked like a meaty book with lots of information on hardening the already paranoid OpenBSD as well as ways to use it without making stupid mistakes.
    • Managing Security with Snort and IDS: There aren’t enough yellow O’Reilly books. Snort has intrigued me for some time and I’d love to read up on it someday.
    • Advanced Unix Programming: I’ve never been a really low-level guy, but I’ve had a newfound respect for plumbing since I’ve been shoving 0’s and 1’s around this semester. This looks like a great reference for low-ish level programming in a Unix (or Unix-like) environment.
    • Knoppix Hacks: I swear, if you leave two Hacks books alone for 20 minutes they’ll mate and have offspring. There really are a lot of things you can do with Knoppix.
    • Essential Mathematics for Games and Interactive Applications : A Programmer’s Guide: This one was showcased a little bit and gets down to the nitty gritty of stuff that you need to do in order to know your stuff. I’m always amazed at how much you need to know about whatever subject you’re coding for.
    • XML Hacks: What did I tell you? There’s another. A bunch of tricks with XML from cool but useless to wow.
    • Python Programming Patterns: I don’t think I’ve seen enterprise-grade patterns using Python before. This looks like a good book for those looking for an excuse to use Python in the workplace.
    • Moleskine by Kikkerland: Some great small notebooks and stuff. They could be great for jotting down notes before they can make their way to my wiki.

    It was great to get out and graze at the bookstore a bit. It has been awhile since I’ve done so. Of course I have a similar number of tech books already on the shelf that I haven’t had a chance to read, but I always want more.

    What books have you looked at lately? I was bummed not to find Mono: A Developer’s Notebook on the shelf, but considering that there were several there last time, I think that’s a good sign.

  • PyCon DC 2005 or Bust

    PyCon DC 2005

    Over the weekend I signed up for PyCon DC 2005, and I’m looking forward to it already. The earlybird deadline has already passed, but PyCon is still probably one of the best values out there as far as geek conferences go. I’m in the DC area so if anyone is going to be in town and would like to get together, let me know and we’ll figure something out. PyCon week also happens to fall during my spring break, which couldn’t have worked out better.

    See you there!

  • Yet Another Reason to Attend PyCon DC 2005

    Here is one more reason to attend PyCon 2005:

    #16. Python for Series 60

    Erik Smartt / Nokia

    UPDATE 2005-01-04:

    A presentation where the Product Manager and one of the engineers do a joint presentation to quickly introduce and demonstrate the port, then cover the technical issues of porting and developing extensions

    In addition to the planned presentation, it would be great to get together a Series 60 Python BoF session or some time in the open space for further meets, greets, and hacking. What do you think? Let us know in the wiki.

  • Pycon 2005 Preliminary Program Announced!

    This gem showed up in my inbox tonight:

    You will be happy to know that the PyCon Program Committee, after lengthy deliberations, has now finalized the program for PyCon DC 2005. I can tell you that the decision-making was very difficult, as the standard of submissions was even higher than last year.

    The preliminary schedule is online.

    It looks like a great collection of stuff this year. I’m going to do my best to make it there and will try to organize a Python for Series 60 BoF or open session. I hope to see everyone there this year!

  • PyCon DC 2005 Registration Open

    Steve Holden:

    Following my last message, I am pleased to be able to
    announce that you can register for PyCon DC 2005 on the
    web at

    http://www.python.org/pycon/2005/register.html

    Rock on! PyCon DC is probably one of the best bang/buck conferences out there, and it’s right in my backyard! I hope to see everyone there this year.

  • Extending Python for Series 60

    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.

  • Python for Series 60 Released!

    Jim, Ewan, and Erik have already spoken about it, but Python for Series 60 is in the wild!

    I’ve been tinkering with the public release and should have some fun stuff to share shortly.

  • /me is back.

    It’s been a long couple of months and I apologize for the hiatus. It’s a long story for another day, but lets put it this way, I’m back! I’ve moved from Radio Userland to WordPress. I promise that I’ll share my (semi-painful and procrastination-ridden) migration process in due time.

    The .css that is currently driving the site is Dots by Alex King, which I’m currently tweaking. I’ve still got some random bits that I need to find and url rewrite to fit the new engine, but I’ve done my best to keep the old permalinks. If you find something that’s whacky, please drop me a line at matt at the domain ooiio.com. Thanks!

  • IronPython Unleashed on the Public

    Edd and others have been covering the big news: IronPython, a really fast implementation of Python that runs on .NET and Mono, has finally been released as open source.  You can read more and snag it at IronPython.com.  The author, Jim Hugunin, has also been snagged by Microsoft.

  • Dive Into Series 60 Python

    For the past month or two, I have been tinkering with Python for Series 60. I regret that I have not had enough time to pound on it, but what I have played with has been awesome. I can parse HTML, like an adaptation from this page of Dive Into Python. When things like from sgmllib import SGMLParser just work, I’m amazed. Hey, check that out, I’m parsing HTML on my phone. Rock!

    Series 60 Python is still a research project at Nokia. There are no guarantees that it will ever see the light of day beyond limited testing. There’s only one problem: sockets. It always comes back to sockets. Don’t get me wrong, sockets are available in Series 60 Python, but you can’t do something like urllib.urlopen(url). That little thing is keeping a lot of people from doing useful things with Series 60 Python. Part of the reason that so many people use and love Python is because it’s sort of runnable pseudocode. It’s intuitive, it makes sense, and the syntax that you think ought to work often does. Once writing a Python app for a platform becomes much harder than that, you start loosing developers quickly. So many killer mobile apps that would be awesome to code in Python involve the following steps:

    1. Grab a specific resource (XML, HTML, etc)
    2. parse the resource and do something with the data
    3. interpret and present the data to the user

    If the first step is overly complicated, or doesn’t work as Python programmers expect it to, you’re going to loose a lot of potential developers quickly. There’s a bit of a catch 22 though: Nokia needs to be sure that Python for Series 60 is a worthwhile project, so they’ve seeded it to developers. However the developers are frustraed because they can’t just type urllib.urlopen(url). Which came first, the useful apps taking full advantage of a connected mobile platform, or the infrastructure to do so?

    It is obvious that Nokia has put a lot of time and effort in to Series 60 Python. There’s a lot beyond your standard Python distro buried in there. It would be an absolute tragedy to see this die half-ripened on the vine. Hey Nokia: you’ve done a great job so far, keep it up! Hey developers and bloggers: make some noise! Play with it. Have fun. Post your thoughts. Let them know what you think.

    Further Reading:

  • Python Development with Eclipse and Ant

    The Daily Python-URL is chock full of Python linkage today.  The one that has the biggest wow factor to me is a link to Python development with Eclipse and Ant at IBM developerWorks.  The article, which I managed to miss when it came out on June 15, details how to set up Eclipse as a Python development environment.  The story glues together PyDev, a Python Eclipse plugin, Python Ant tasks, and even manages to make mention of Mark’s feed parser.

    The eclipse solution sounds like it would be much more elegant and coherent than my current uses of Pythonwin and IDLE on Windows and the text editor of the moment, the command line, and the interactive interpreter on Linux (usually over SSH).

  • Feed Parser 3.0

    The Universal Feed Parser turned 3.0 yesterday.  It has a new home, online docs, and oodles of tests.  It also makes julian fries.  Seriously though, Mark’s feed parser can snag data from pretty much any feed you throw at it, no matter how whacked out it may be.

  • Pythonic SSH: paramiko

    PyPI listed this little gem this evening: paramiko.  What is paramiko?  It is an SSH2 implementation in Python.  Here’s some more information from PyPI:

    This is a library for making SSH2 connections (client or server). Emphasis is on using SSH2 as an alternative to SSL for making secure connections between python scripts. All major ciphers and hash methods are supported.

    SFTP client mode is now supported too.

    paramiko relies on PyCrypt, which is like a Pythonic Bouncy Castle.

  • Wikis Help in a Pinch

    EWeek:

    For about six hours yesterday, the staff of eWEEK.com was treated to a lesson in emergency improvisation. But thanks to 123 lines of Python code, running on a $7-a-month personal Web site on an Apache Web server somewhere in California, you probably didn’t notice.

    This is an excellent story of improvisation at its finest.

  • Finding Bad Feeds in Your Rawdog Feed List

    Rawdog has been segfaulting on me for awhile now.  It was definitely not Adam Sampson’s fault, it was totally mine.  I aparently copied and pasted an HTML link to my feed list instead of an RSS feed.  Oops!

    Anyway, I’ve not been able to get my RSS fix for some time, and I finally got around to writing a few lines of Python to diagnose the problem.  In about 9 lines of code I’m able to read my config file line by line, check to see if the line represents a feed listing, grab the url from the line, print the feed url, and parse it using Mark’s feed parser (the same version that Rawdog is using).

    The feed section of a Rawdog config file (usually in ~/.rawdog/config) can look like either of the following:

    feed 60 http://postneo.com/rss.xml
    feed 1h http://postneo.com/rss.xml

    The top line is what the older version of Rawdog uses, the lower line is what newer versions of Rawdog uses.  Luckily each line is “feed” + <time> + <url>, so the string can just be split and I can grab the URL with foo[2].

    Here is the result of my two minute hack to figure out where the segfaults are coming from:

    import feedparser

    f=open('config', 'r')
    for line in f.readlines():
      if line.startswith('feed'):
        foo = line.split()
        print 'parsing ' + foo[2]
        data = feedparser.parse(foo[2])
    f.close()

    This will skip over any comments (lines that start with #) and other directives in the Rawdog config file.  I ended up making a backup, running the checker until I came across an error, commented out the offending feed in the backup file, and then removed all feeds in the file I was checking up to and including the offending feed.  This way I wasn’t hammering feeds in the beginning of the list.  Rinse, later, repeat.  It wasn’t until down at the bottom that I found the link that was causing the segfault: a link to one of my posts.  Sheesh.

    But hey, with a few lines of python and a few minutes, I’m back up and running.

  • Prepping for PyCon

    PyCon DC 2004 is coming.  It happens March 24-26.  I should be there for sure on Wednesday, but I don’t know if I’ll be able to make it Thursday or Friday.  The schedule of talks makes me think that this is going to be the Python event of 2004.

  • OSCON 2004 and PyCon DC 2004

    The official Call for Participation at O’Reilly’s Open Source Convention 2004 went out today.  The general theme is “Opening the Future: Discover, Develop, Deliver,” which you can interpret to suit your needs.  Proposals for OSCON are due by Febrary 9.

    Proposal submissions for PyCon DC 2004 are also online.  The deadline for proposals for PyCon DC 2004 is January 15.  More information is at the call for proposals page.

  • PyCon DC 2004

    Jeremy Hylton:

    The Python conference will be held March 20-26, 2004 at George Washington University in Washington, D.C. PyCon registration is open, and the final call for papers will be posted next week. Mitch Kapor is the keynote speaker.

    I punked out last year because of funds, but there’s really no excuse not to attend this $175 conference.  I can’t wait!

  • Python 2.3.3c1 (Release Candidate 1) is Out!

    According to the Daily Python-URL, Python 2.3.3c1 is out.  This release features major bugsquashing, tweaks to xml.processors.expat, and a digest auth fix in urllib2.

  • OpenPGP in Python

    Via PyPI, OpenPGP in Python is just that.  The author is also learning about Python as he goes:

    This is an attempt at implementing OpenPGP in Python. This is also my first attempt at doing anything real in Python so [insert disclaimers and cries for help here]. I’m classifying this as “Pre-Alpha” since major changes are still pretty frequent. For testing in the meantime, an API and fairly usable command line application are included.

    PyOpenPGP requires PyCrypto.  Don’t let the humble author fool you, check out the demo.