Message4213
| Author |
prescod |
| Recipients |
| Date |
2001年04月11日.18:52:39 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 13:53:50 | admin | link | issue415492 messages |
| 2007年08月23日 13:53:50 | admin | create |
|