Variables and their domain

Jose Ignacio Gisbert jigisbert.etra-id at grupoetra.com
Thu Nov 29 12:40:20 CET 2007


Hi all,

 

I have one doubt, in my applciation I have a method (Method1) which has
other method (Method2) inside of it. Ok, in my first method I define a
variable "lista" which is an array, an other one, "lb", which is a listbox
with some elements inserted from lista. Then, when I do a double click on a
lb element, I go to Method 2, where I can continue inserting elements in lb
and reading lista, but if I do "lista=..." I get an error of local variable
referenced.   The problem is that if I do lb and lista global variables, I
have to declare them outside any method, haven't I?. If someone could help
me I would be very pleased.

 

Resume:

 

Main

            Method1

                        Lista=a,b,c,d.

                        Lb=listbox

                        Method2

                                   Lista=e,f,g..   -->error!

 

 

 

Thanks in advance

 

Best Regars,

Naxo       

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071129/037f4b2b/attachment.html>


More information about the Python-list mailing list