steve at holdenweb.com
Wed May 17 10:45:39 CEST 2006
> Hi all,
> THis is my blog and This is related to python utilities for system and
> network administration.plz comment on this
> Vineesh Kumar
The biggest problem seems to be the failure of indentation in the
published code, which will make the code hard to read and impossible to
copy-and-paste should anyone wish to use it.
I run code through a colorizer program before publishing it (do a Google
search for "colorize.py") in my blog - see for example:
With space indentation rather than tabs, it seems to copy-and-paste
The only other question I have is related to your use of strings instead
of comments. Where you want them to be the docstring for a function or
class or method you should have them at the first line of the body, as in:
"""This is the first line of a multi-line docstring.
The second and subsequent lines, if any, should appear
indented like this."""
You also seem to use strings rather than comments at the end of
statements. It appears these have been added after the fact, since they
introduce syntax errors, as in
sleeptime=15 """The time to wait for getting a response from the router"""
It's always a good idea to take published code and verify that it will
indeed compile and run as published. It's so easy to make mistakes in
any of the transcription steps. (Having written a book helps in this
respect, as there are myriad ways that publishers can screw up perfectly
good code and you learn *all* about them int he authorship process).
I'm sure that there are lots of net and sys admins who would love to be
able to get their hands on these simple but helpful programs, so I'd
encourage you to polish up your code and keep helping to make Python
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Love me, love my blog http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
More information about the Python-list