Seite 1 von 1

Suche was wie "from ./dir/dir/utils.py import bla"

Verfasst: Freitag 22. Juni 2007, 12:07
von monocult

Code: Alles auswählen

from ./dir/dir/utils.py import bla
geht so was irgendwie?

Verfasst: Freitag 22. Juni 2007, 12:30
von birkenfeld

Code: Alles auswählen

import sys
sys.path.append("./dir1/dir2")
from utils import bla
Oder, wenn dir2 ein Package ist, z.B. auch

Code: Alles auswählen

sys.path.append("./dir1")
from dir2.utils import bla
Etc.