Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Hermann Riemann Newsgroups: de.comp.lang.python Subject: Re: import Problem Date: Fri, 28 Apr 2017 14:48:18 +0200 Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net z5na1JNzXd/5YI9CJtHA7wbd1GQNF4LOPl4JmCVvBeaXTCOJa5 Cancel-Lock: sha1:irFwcnsd9DrOykzlX0/QFM1Aswg= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: csiph.com de.comp.lang.python:4757 Am 28.04.2017 um 07:55 schrieb Hermann Riemann: Aktueller Stand: #---------------------------- globale_funktionen.py import globale_variable g=globale_variable.variablen def f(): g.x=1 #---------------------------- globale_variable.py class Globale_Variablen: def __init__(self): self.x=0 def f(self): f() variablen=Globale_Variablen() from globale_funktionen import * import initialisiere #---------------------------- initialisiere.py import globale_variable g=globale_variable.variablen g.f() #---------------------------- test.py import globale_variable g=globale_variable.variablen print(g.x) Hermann der die Verzögerungen durch def f(self): f() in Kauf nimmt. -- http://www.hermann-riemann.de