简体   繁体   English

为什么python .pyc文件包含其源代码的绝对路径?

[英]Why do python .pyc files contain the absolute path of their source code?

Why do python .pyc files contain the absolute path of their source code, instead of a relative path or something else? 为什么python .pyc文件包含其源代码的绝对路径,而不是相对路径或其他东西?

A typical __init__.pyc from Python 2.7 on Ubuntu: Ubuntu上Python 2.7的典型__init__.pyc

\�\�\�Oc@sddlTdS(i\�\�\�\�(t*N(tdbapi2(((s&/usr/lib/python2.7/sqlite3/__init__.py<module>s

To give the information in tracebacks. 提供追溯信息。 See for instance http://docs.python.org/library/compileall#cmdoption-compileall-d 例如,参见http://docs.python.org/library/compileall#cmdoption-compileall-d

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM