我正在学习如何阅读python文档,减少对互联网示例的依赖。不容易,但我会努力的
在python cli中,我
import os
当Ihelp(os)
时,返回以下输出
CLASSES builtins.Exception(builtins.BaseException) builtins.OSError builtins.object nt.DirEntry builtins.tuple(builtins.object) nt.times_result nt.uname_result stat_result statvfs_result terminal_size class DirEntry(builtins.object) | Methods defined here:
在os.py源文件中找不到class DirEntry
。有人能告诉我为什么help(os)
返回DirEntry吗
如果打印
os.DirEntry
的表示形式,并且如帮助中所示,它是对象nt.DirEntry
(因为您在windows系统上):从
os
模块中的nt
导入DirEntry
的位置如下:from nt import *
从nt
模块导入(大部分)所有内容,这是DirEntry
添加到os
模块的地方相关问题 更多 >
编程相关推荐