Re: [Tutor] General Feedback, Script Structure

2009-02-15 Thread Damon Timm
Kent and Alan - thanks! I moved things around a bit and I think it "looks" better: http://python.pastebin.com/m64e4565d On Sun, Feb 15, 2009 at 2:25 PM, Kent Johnson wrote: > Exactly. dict.get() does a key lookup with a default for missing keys, > then the result is used as a string format. See

Re: [Tutor] General Feedback, Script Structure

2009-02-15 Thread Kent Johnson
On Sun, Feb 15, 2009 at 1:01 PM, Damon Timm wrote: > On Sun, Feb 15, 2009 at 12:20 PM, Kent Johnson wrote: >> - put the main code in a main() function rather than splitting it >> across the file. > > That's a good idea - I will do that. Is it proper to create a def > main() or just under: if __

Re: [Tutor] General Feedback, Script Structure

2009-02-15 Thread Alan Gauld
"Damon Timm" wrote It works fine -- seems to do what I need -- but, to be very frank, I don't think it is very *pretty* ! But, I am not sure what the http://python.pastebin.com/m4e1694d5 Would be interested in any feedback (obviously, I should add some doc strings!). It doesn't look to

Re: [Tutor] General Feedback, Script Structure

2009-02-15 Thread Damon Timm
Hi Kent - thanks for taking a look! Follow-up below: On Sun, Feb 15, 2009 at 12:20 PM, Kent Johnson wrote: > - put the main code in a main() function rather than splitting it > across the file. That's a good idea - I will do that. Is it proper to create a def main() or just under: if __name__

Re: [Tutor] General Feedback, Script Structure

2009-02-15 Thread Kent Johnson
On Sun, Feb 15, 2009 at 11:00 AM, Damon Timm wrote: > Hi - > > Am still new to python -- was writing a script that is used by mdadm > (linux software raid utility) when there was a raid "event" ... the > script then sends an email (using another python script caled > "gmailme") to me with the info

[Tutor] General Feedback, Script Structure

2009-02-15 Thread Damon Timm
Hi - Am still new to python -- was writing a script that is used by mdadm (linux software raid utility) when there was a raid "event" ... the script then sends an email (using another python script caled "gmailme") to me with the information from the event and attaches the details of the raid devi