Anonymous hat geschrieben:hi Francesco,
danke dir.
Zusammenfassung:
import inspect
import os
inspect(os)
====><module 'os' from 'C:\Programme\Python241\lib\os.pyc'>
MfG
Bitte,
muesste noch einfacher gehen:
import re
inspect.getfile(re)
'C:\\Python24\\lib\\re.pyc'
aber:
da muesste man die exception abfangen, da sys ein internes
module ist:
inspect.getfile(sys)
Traceback (most recent call last):
File "<input>", line 1, in ?
File "C:\Python24\lib\inspect.py", line 312, in getfile
raise TypeError('arg is a built-in module')
TypeError: arg is a built-in module