
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
die hacker lösung:
import sys, os sys.path.append( os.path.join( os.getcwd, "classes" ) )
from xyz import *
für paranoiker gibts noch: sys.path.insert( 0, os.path.join( os.getcwd, "classes" ) )
die saubere lösung: im Verzeichnis "classes" ein module "__init__.py" anlegen, damit wird classes zu einem paket und man kann einfach
from classes.xyz import *
schreiben.
HTH, Gerald
PS: Schneller gehst auf irc://irc.freenode.net#python.de
Stefan Miefert schrieb: | Hallo, | | ich importeire derzeit Dateien mit z.B. | | from xyz import * | | Dabei sucht u.a. im aktuellen VErzeichnis. Wie kann ich aber eine Datei | in dem Unterordner classes des aktuellen Verzeichnisses importieren? | | MfG | | Stefan | | | _______________________________________________ | python-de maillist - python-de@python.net | http://python.net/mailman/listinfo/python-de
- -- GPG-Key: http://keyserver.veridis.com:11371/search?q=0xA140D634
_______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de