Message4213
Make a file called "test.py"
----
import pack
print pack.func.func_code.co_filename
-----
Make a directory called "pack". Put a file in it
called "__init__.py" with the contents:
def func(): pass
Now run test.py. It will compile a relative path into
these modules. Now you can change to any directory on
the system and run test.py and it will return the
original relative path. The problem is that the
relative path is compiled into the .pyc. It should be
an absolute path. |
|
Date |
User |
Action |
Args |
2007-08-23 13:53:50 | admin | link | issue415492 messages |
2007-08-23 13:53:50 | admin | create | |
|