AW: [Python-de] import von modules
Josef Cihal
josef.cihal at irm.at
Thu Nov 14 16:01:27 EST 2002
danke
ich habe das Problem mit try:, excpet: clause gelöst,
Abfrage auf sys.platform is auch eineelegante Lösung.
Danke für Hilfe!
lg
josef
-----Ursprüngliche Nachricht-----
Von: python-de-admin at python.net [mailto:python-de-admin at python.net]Im
Auftrag von Thilo Ernst
Gesendet: Donnerstag, 14. November 2002 10:15
An: python-de at python.net
Betreff: Re: [Python-de] import von modules
Josef Cihal schrieb:
> Skript1.py:
> >import win32process
> >DEF_abcd = "TEST"
>
> Skript2.py:
> from Skript1 import DEF_abcd
>
> Ich brauche unter UNIX aus einem modul Skript1 nur die Defines zu
> importieren(nihct die win32process library),
> es werden aber gleichzeitig auch die imports in der Importdatei
mitgenommen?
> Wie geht es anders?
Die "Defines" in ein eigenes Modul verlagern:
Defines.py:
DEF_abcd="TEST"
Skript1.py:
import win32process
from Defines import DEF_abcd
Skript2.py:
from Defines import DEF_abcd
...
Geht natürlich nur, wenn Skript1 unter Deiner Kontrolle ist.
Gruss, Thilo
_______________________________________________
Python-de maillist - Python-de at starship.python.net
http://starship.python.net/mailman/listinfo/python-de
More information about the Python-de
mailing list