Warum wird das Modul 'os' nach folgender Anweisung nicht geladen?
Code: Alles auswählen
mod = __import__('os', globals(), locals())
os.path.basename("c:\windows\test.txt")
Traceback (most recent call last):
File "test.py", line 42, in <module>
print os.path.basename("c:\windows\test.txt")
NameError: name 'os' is not defined
Warum? Was mache ich falsch?