It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




已关闭8年。




我正在做一些我无法完全谈论的事情。我只能说我是信息安全和计算机科学专业的学生。

我只需要更改python内部深处的某些源代码。现在,我特别想更改内置打印功能中的源代码。不幸的是,我找不到它在python源代码文件中的任何位置定义了。

有什么想法吗?

非常感谢。

编辑:专门用于询问是否可以用其他东西覆盖Python中的打印功能的问题。这是为了在Python解释器中植入后门。

最佳答案

在cpython中,print函数是用C实现的,而不是Python。您可以找到source code here,但是必须重新编译cpython才能使更改生效。

对于Python中print的实现,请查看pypy's version

关于python - 需要在python中找到print或printf的源代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13098524/

10-12 14:51
查看更多