On Mon, 29 Oct 2007 09:03:14 +0000, [EMAIL PROTECTED] wrote:

> Im tryin to call a var thats sitting in a function, example:
> 
> class someclass(object):
>          somevar = open(blah, 'r').readlines()

Thats a class variable.  Is that really what you want!?

> def something():
> 
>         for line in somevar:
>              print line
> -----------------------------------------------------------------------
> 
> i  guess im not graspng the whole global or local var topic..

There is no real global here.  One is (somewhat) local to the class the
other local to the function.

> Any examples??

def something(lines):
    for line in lines:
        print lines

And the call it with the object.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to