gt; Från: Evert Rol [mailto:evert@gmail.com]
> Skickat: den 30 maj 2010 18:34
> Till: Robert Johansson
> Kopia: tutor@python.org
> Ämne: Re: [Tutor] namespaces
>
> Hi Robert
>
> > This code generates the message "UnboundLocalError: local variable
>
Thanks Evert for pointing out the difference and the discussion on global
variables, it helped.
/Robert
-Ursprungligt meddelande-
Från: Evert Rol [mailto:evert@gmail.com]
Skickat: den 30 maj 2010 18:34
Till: Robert Johansson
Kopia: tutor@python.org
Ämne: Re: [Tutor] namespaces
Hi Robert
> This code generates the message “UnboundLocalError: local variable 'doubles'
> referenced before assignment” (line: if d[0] == d[1] and doubles == 2:)
>
> http://pastebin.com/mYBaCfj1
>
> I think I have a fair picture of what it means but I would be very happy if
> someone co
Hi,
This code generates the message "UnboundLocalError: local variable 'doubles'
referenced before assignment" (line: if d[0] == d[1] and doubles == 2:)
http://pastebin.com/mYBaCfj1
I think I have a fair picture of what it means but I would be very happy if
someone could explain the d
Jose Amoreira wrote:
Alan, Kent, hello!
Thanks for your help. As for your "curiosity", I'm teaching elementary physics
to undergraduates in computer engineering. Trying to speak my students'
language, I wanted to show them simple applications that compute numerical
values for the kinematics fo
Alan, Kent, hello!
Thanks for your help. As for your "curiosity", I'm teaching elementary physics
to undergraduates in computer engineering. Trying to speak my students'
language, I wanted to show them simple applications that compute numerical
values for the kinematics formulas of uniformly acc
"Jose Amoreira" wrote
Of course I could redefine my module function, including the parameter a
in
the list of arguments, but I'd rather not.
Why not? That would be good computer science practice and the
most reliable way to do it. Why do you not want to go down that
route? Is there a specif
On Wed, Oct 14, 2009 at 7:26 AM, Jose Amoreira wrote:
> I want to use a variable defined in an interactive session with the python
> interpreter inside a function imported from a module.
>
> For instance, imagine that my module (call it defs.py, for instance) consists
> of:
> #coding=utf-8
> def
Hello
I'm new to this list. I tried to find the answer to my question but found
nothing I could really use. I'm sorry if this is a FAQ.
I want to use a variable defined in an interactive session with the python
interpreter inside a function imported from a module.
For instance, imagine that my
John Gunderman wrote:
> I am new to python and have found both the concept of namespaces and the
> __dict__ function to be rather confusing, and I cant find any good
> explanations on the web. Could any of you give me a good explanation of
> these? And for __dict__, is is the same thing as __str
I am new to python and have found both the concept of namespaces and the
__dict__ function to be rather confusing, and I cant find any good explanations
on the web. Could any of you give me a good explanation of these? And for
__dict__, is is the same thing as __str__ except in string form, or d
11 matches
Mail list logo