[Python-de] Re: local variable referenced before assignment?

Ulli Horlacher <[email protected]>
Newsgroups gmane.comp.python.general.german
Organization University of Stuttgart, FRG
Message-ID <[email protected]>
Ulli Horlacher <[email protected]> wrote:
> Ich bekomme diesen Fehler und verstehe ihn nicht:
> 
>     config()
>   File "./fextasy.py", line 496, in config
>     sg.I(server,key='server',tooltip='F*EX server',size=80)],
> UnboundLocalError: local variable 'server' referenced before assignment
> 
> 
> def config():
>   read_config()
> 
>   col = [
>     [sg.I(server,key='server',tooltip='F*EX server',size=80)],

Habs... :-}

Weiter unten im Code hatte ich noch ein ueberfluessiges 
server = ...
stehen. 

Was ich daraus gelernt habe: 
Der Python Parser schaut sich das zur compile-time an, nicht zur Laufzeit. 


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: [email protected]
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
_______________________________________________
python-de Mailingliste -- [email protected]
Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an [email protected]
https://mail.python.org/mailman3/lists/python-de.python.org/
Mitgliedsadresse: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.