Re: [Tutor] no attribute

2008-12-11 Thread Lie Ryan
On Thu, 11 Dec 2008 21:56:19 +, Alan Gauld wrote: > "Bryan Fodness" wrote > >>I am trying to change values in a file. The following code does not >>seem to >> find the attribute. >> >> def anonymize(obj, attr): >>try: >>obj.attr = 'Anonymize' >>except AttributeError: >>

Re: [Tutor] no attribute

2008-12-11 Thread Alan Gauld
"Bryan Fodness" wrote I am trying to change values in a file. The following code does not seem to find the attribute. def anonymize(obj, attr): try: obj.attr = 'Anonymize' except AttributeError: pass This code is looking for an attribute of obj called attr It is not us

[Tutor] no attribute

2008-12-11 Thread Bryan Fodness
I am trying to change values in a file. The following code does not seem to find the attribute. def anonymize(obj, attr): try: obj.attr = 'Anonymize' except AttributeError: pass for fname in os.listdir(os.curdir): plan=ReadFile(fname) anonymize(plan, 'Name') It s