Re: [Tutor] Program review

2008-01-06 Thread Jeff Younker
> > Maybe it is my poor understanding of exception handling. My intention > here is to open the first file, if error then report in logging and > finish normally, else open the 2nd file, if error then report in > logging > close the 1st file and finish normally. If no error then process. > Right

Re: [Tutor] locating python scripts

2008-01-06 Thread Brendan Rankin
max baseman gmail.com> writes: > > hey i just have a small question, doesn't have much to do with > programing but it has to do with python. > anyways Im running a apple computer version 10.4 and have been > keeping my scripts in the user folder i was wondering where and how i > can chang

Re: [Tutor] Program review

2008-01-06 Thread Ricardo Aráoz
Ok, now the "tested" version (has been corrected) : #!/usr/bin/env python import time import smtplib import email import ConfigParser import logging class Mensaje(object) : def __init__(self) : cfg = ConfigParser.ConfigParser() try : cfg.readfp(open('config.cfg'))

[Tutor] locating python scripts

2008-01-06 Thread max baseman
hey i just have a small question, doesn't have much to do with programing but it has to do with python. anyways Im running a apple computer version 10.4 and have been keeping my scripts in the user folder i was wondering where and how i can change the files that python looks in when looking

Re: [Tutor] Program review

2008-01-06 Thread Ricardo Aráoz
Jeff Johnson wrote: > I would like to "butt" in here and mention that this is some of the most > useful information I have seen! I am a programmer of 25 years that is > new to Python. This type of back and forth dialog on actual production > code is extremely useful to learning the language.

Re: [Tutor] Program review

2008-01-06 Thread Ricardo Aráoz
Ok, new version. In procesar() I tried getting rid of the outer try block and having 'return' instead of 'raise' in the inner try blocks but I didn't like the result. I'd rather have one more indent level but have only one exit point from the function. Redesigned class Mensaje so that it now includ

Re: [Tutor] Program review

2008-01-06 Thread Ricardo Aráoz
Kent Johnson wrote: > Ricardo Aráoz wrote: >> Jeff Younker wrote: > >>> The enclosing try block isn't needed. More on this later. > >> Maybe it is my poor understanding of exception handling. My intention >> here is to open the first file, if error then report in logging and >> finish normally,

Re: [Tutor] Program review

2008-01-06 Thread Kent Johnson
Ricardo Aráoz wrote: > Jeff Younker wrote: >> The enclosing try block isn't needed. More on this later. > Maybe it is my poor understanding of exception handling. My intention > here is to open the first file, if error then report in logging and > finish normally, else open the 2nd file, if erro

Re: [Tutor] classes and the deepcopy function

2008-01-06 Thread bob gailer
Michael wrote: > Okay > > Just when I think I am getting it you throw this in. You're welcome. > So why does a become local to each variable but b seem global? > A better way to ask that is "why does a become an instance property but b remain a class property?" f.a = 3 This is an assignment

Re: [Tutor] Program review

2008-01-06 Thread Ricardo Aráoz
Jeff Younker wrote: > The procesar function is complicated. It tries to do several things > that that are better done elsewhere. It needs to be broken up into > several functions and methods. This also clarifies and isolates the > exception handling. > >> def procesar(mensaje): >>try : >

Re: [Tutor] classes and the deepcopy function

2008-01-06 Thread Michael
Okay Just when I think I am getting it you throw this in. So why does a become local to each variable but b seem global? Michael bob gailer wrote: > Michael wrote: >> Hi Michael >> >> Thanks for the quick reply, I think I get it. So becuase I did not >> declare them withing the init method usi