On Thu, May 6, 2010 at 5:33 PM, Alex Hall <mehg...@gmail.com> wrote: > Hi all, > I have a file, pasted below for what good it will do, which makes a > couple conditional calls to a function called writeDefaults. However, > when I manually trigger a condition that causes the function to be > called, Python gives me a name error and says that my writeDefaults > does not exist. I am sure that it does, as I copied the text from the > call and pasted it into the text search of my editor, and it found the > line that defines the function, so the text in the call is obviously > correct.
You're calling the function before you've defined it; that doesn't work in Python. `def`s are executable statements, not declarations like in statically-typed languages. Move the "def writeDefaults():" and its body so it comes before the "#first, load the ini file setting" code. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list