[Python-de] include von config-files
Roland M. Kruggel
rk.liste at bbf7.de
Di Aug 14 20:45:29 UTC 2007
Am Dienstag, 14. August 2007 20:35 schrieb Georg Mischler:
> Georg Brandl wrote:
> > Roland M. Kruggel schrieb:
> > > Hallo Liste,
> > >
> > > kann ich einen, z.b. Konfigurationsfile, mit include laden der
> > > nicht die endung .py hat und z.b. im /etc liegt?
> >
> > Dazu empfehle ich execfile().
>
> execfile() startet einen neuen Prozess, was den Zugriff auf die
> geladenen Konfigurationsinformationen etwas umständlich macht...
>
> Für die Problemstellung wird normalerweise __import__() verwendet.
> http://docs.python.org/lib/built-in-funcs.html#l2h-6
Danke. Ich glaube das ist genau das was ich gesucht habe
--
cu
Roland Kruggel mailto: rk.liste at bbf7.de
System: Intel, Debian etch, 2.6.16.16, xfce4 KDE 3.5
user disclaimer (text)
Roland M. Kruggel
______________________________
bbf7.de, Roland Kruggel
Wilhelmstr 59 - 58762 Altena
Tel.: +49 2352 / 207333
Handy: +49 176 / 23198511
www: <http://www.bbf7.de
Inh.: Roland Kruggel
UstId: 302/5068/1169