Re: Newbie NameError problem

2007-12-13 Thread cokofreedom
On Dec 12, 7:03 pm, Paul Rudin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > On Dec 12, 5:51 pm, Paul Rudin <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] writes: > >> > I don't understand what I don't understand in the following: > > >> I haven't tried to understand what your code

Re: Newbie NameError problem

2007-12-12 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Thanks to all! > > I will put my class defs first (tho not without expressing my > disappointment that this is required in a late 20th century language); That's because you dont get the "execution model" of Python. First point, remember that Python in Python everyth

Re: Newbie NameError problem

2007-12-12 Thread Carsten Haese
On Wed, 2007-12-12 at 12:48 -0800, [EMAIL PROTECTED] wrote: > Thanks to all! > > I will put my class defs first (tho not without expressing my > disappointment that this is required in a late 20th century language); You don't have to physically *put* class definitions first in your code. What mat

Re: Newbie NameError problem

2007-12-12 Thread MartinRinehart
Thanks to all! I will put my class defs first (tho not without expressing my disappointment that this is required in a late 20th century language); learn about enumerate as it looks like exactly what I need and discard my C++/Java based object model because this is a totally other thing. If someo

Re: Newbie NameError problem

2007-12-12 Thread Paul Rudin
[EMAIL PROTECTED] writes: > On Dec 12, 5:51 pm, Paul Rudin <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] writes: >> > I don't understand what I don't understand in the following: >> >> I haven't tried to understand what your code is doing - but the >> NameError arises because you try to use Loc

Re: Newbie NameError problem

2007-12-12 Thread Sion Arrowsmith
<[EMAIL PROTECTED]> wrote: >I don't understand what I don't understand in the following: > [ ... ] You've already got an answer as to what's causing your name error. But that's not your only problem. It looks like you need an introduction to enumerate(): for line_ptr, text in enumerate(file('sam

Re: Newbie NameError problem

2007-12-12 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I don't understand what I don't understand in the following: You already have the answer (hint: a Python module is sequentially executed when loaded by the interpreter) Just a couple side notes: > # but I need locations, so this is impure, 11-line, Python: > > l

Re: Newbie NameError problem

2007-12-12 Thread cokofreedom
On Dec 12, 5:51 pm, Paul Rudin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > I don't understand what I don't understand in the following: > > I haven't tried to understand what your code is doing - but the > NameError arises because you try to use Loc before its definition. Put > the d

Re: Newbie NameError problem

2007-12-12 Thread Paul Rudin
[EMAIL PROTECTED] writes: > I don't understand what I don't understand in the following: I haven't tried to understand what your code is doing - but the NameError arises because you try to use Loc before its definition. Put the definition first and the error should go away. -- http://mail.pyth

Re: Newbie NameError problem

2007-12-12 Thread Calvin Spealman
On Dec 12, 2007, at 11:26 AM, [EMAIL PROTECTED] wrote: > I don't understand what I don't understand in the following: You also don't understand how to ask for help properly. Your example is too large, for one. You want a "minimal working example" (http:// ironfroggy-code.blogspot.com/2007/02/m