Changing global variables in tkinter/pmw callback

Brian Elmegaard be at mek.dtu.dk
Fri Apr 6 02:09:29 EDT 2001


Fredrik Lundh wrote:
> 
> how about two and a half words: "they're not" ;-)

:)

> 
> confusing?

A bit.

> ("normal variables", like integers, floats, strings, belong to
> this category.  if you want a new integer/float/string value,
> you have to create a new object)

I think it's more the methodology in bindings that confused me, and then
lambdas also.


> (when you type "s[0] = 10", you ask whatever "s" points to
> to replace item zero with a new value.  in your case, you ask
> the list "s" to modify it's first item.  anyone else referring to
> the same list object will see this change)

And someone are. Could the same be done with the 10 in s=10? If not then
why?

> now read alex' reply once or twice.  then read the "python

six times that was...

> objects" page again, and make sure you understand every-
> thing in there.  

I shall try.


> 
> (or maybe you're more confused than ever.  in that case,
> we do apologize for the inconvenience...)

I think I am learning, but I am not understanding the technicalities.

Thanks a lot.
-- 
Brian
http://www.et.dtu.dk/energysystems
http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug
\TeX, tak



More information about the Python-list mailing list