a dummy python question

2005-08-25 Thread Learning Python
A example in learning Python by Mark Lutz and David Ascher about function scope example like this: >>def outer(x): def inner(i): print i, if i: inner(i-1) inner(x) >>outer(3) Here supposely, it should report error, because the function inner cannot see

Re: a dummy python question

2005-08-25 Thread Learning Python
Thanks all for replying. I finally know what's going on. -- http://mail.python.org/mailman/listinfo/python-list

argument matching question

2005-08-25 Thread Learning Python
I know this is dummy, just never saw an example of this. I want to use the special argument matching. A code like this: def adder(**varargs): sum=varargs[varargs.keys()[0]] for next in varargs.keys()[1:]: sum=sum+varargs[next] return sum print adder( "first","

Re: argument matching question

2005-08-25 Thread Learning Python
thanks, got it. I want to test the **name option for argument matching. -- http://mail.python.org/mailman/listinfo/python-list

circular import problem

2005-09-09 Thread Learning Python
An example in the book I didn't understood well two modules files recursively import/from each other in recur1.py,we have: x=1 import recur2 y=1 in recur2.py, we have from recur1 import x from recur1 import y If we run interactively at python command line, >>> import recur1 it has errors li

intermediate python csv reader/writer question from a beginner

2009-02-23 Thread Learning Python
anything related to csv, I usually use VB within excel to manipulate the data, nonetheless, i finally got the courage to take a dive into python. i have viewed a lot of googled csv tutorials, but none of them address everything i need. Nonetheless, I was wondering if someone can help me manipulat