Small Mosaic


Categories:

/books
/career
/codinghorrors
/events
/geekstuff
/justdont
/languages
/languages/bash
/linkshot
/magazines
/meta
/misctech
/movies
/nottech
/operatingsystems
/operatingsystems/linux
/operatingsystems/linux/debian
/operatingsystems/solaris
/perl
/presentations
/programming
/python
/ruby
/security
/security/apache
/security/tools
/serversmells
/services
/services/dns
/sites
/specifications
/sysadmin
/testing
/tools
/tools/commandline
/tools/firefox
/tools/gui
/tools/network
/tools/online
/tools/online/greasemonkey
/tools/puppet
/unixdaemon

Archives:

July 20111
June 20112
May 20113
April 20112
March 20117
January 20111
December 20103
November 20103
August 20101
July 20101
June 20104
May 20102
April 20101
March 20108
February 20101
January 20102
Full Archives

Sat, 04 Jul 2009

Baby Steps with Python
Thanks to the enthusiasm I've returned from EuroPython with (and the fact I couldn't make it to OpenTech because of washing machine issues) I decided to spend a little bit of time porting Nagios Webchecks to python. As a use case it covers a lot of the functionality I need in my day to day system scripts. The ability to specify command line arguments, read a config file and interpolate a template file for output.

I'm no where near finished (and I need to spend a lot more time with Python in a Nutshell before I'm going to feel comfortable) but there's been nothing too horrible so far. Libraries returning tuples rather than lists still feels a little awkward but I suspect that's just me being new to this. ConfigParser seems to meet my current ini file reading needs (which are pretty simple) and Jinja2 looks like a decent template engine. Biggest personal bugbear so far is that using % when printing a variable feels wrong ( print "Hello %s", name feels a lot more comfortable than print "Hello %s" % name and is a more common format across languages.)

I'll show the code to a co-worker or two on Monday and hopefully pickup some constructive criticism as they destroy my slightly too perlish attempt at python code.

Like this post? - Digg Me! | Add to del.icio.us! | reddit this!

Posted: 2009/07/04 18:30 | /python | Permanent link to this entry | This entry and same date


books career codinghorrors events geekstuff justdont magazines meta misctech movies nottech operatingsystems/linux operatingsystems/linux/debian operatingsystems/solaris perl programming python ruby security security/apache security/tools serversmells services/dns sites sysadmin testing tools tools/commandline tools/firefox tools/gui tools/network tools/online tools/online/greasemonkey tools/puppet unixdaemon

Copyright © 2000-2010 Dean Wilson XML feed logo