这和我的 another question 有点关系.
在所有获取函数源的方法中:
- getsource 不工作
- os.scandir 没有
__file__属性,所以你不能只是os.scandir.__file__。 - 扫描source file in python github repo没有发现任何有趣的东西。
如有任何建议,我们将不胜感激。
请您参考如下方法:
On Unix-based systems, scandir() uses the system’s opendir() and readdir() functions. On Windows, it uses the Win32 FindFirstFileW and FindNextFileW functions.
如果您想了解幕后发生的事情,我建议您查看这些内容。
