我们如何引用以“开始”开头的术语__&引用;用python

我们如何引用以“开始”开头的术语__&引用;用python,python,python-2.7,Python,Python 2.7,当我以dir(sys)为例时,我想知道所列项目的术语 更清楚的是,我们将如何引用这些调用跟踪或调用启动或版权。它们会被称为“方法”吗?我们如何知道目录列表中每个属性的用法 >>>import sys >>>dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_

当我以dir(sys)为例时,我想知道所列项目的术语

更清楚的是,我们将如何引用这些调用跟踪或调用启动或版权。它们会被称为“方法”吗?我们如何知道目录列表中每个属性的用法

>>>import sys
>>>dir(sys)

['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_traceback', 'exc_type', 'exc_value', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'getwindowsversion', 'hexversion', 'last_traceback', 'last_type', 'last_value', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'py3kwarning', 'setcheckinterval', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions', 'winver']
通常,
dir(…)
命令将显示类中存在的所有属性的列表。e、 g.
sys
模块具有属性
“\uuuuu displayhook\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

如果我正确理解了您的问题,那么是的,在您的情况下,它们将作为方法在sys模块上调用,该模块包含
调用跟踪
调用开始
版权
方法

有关类的每个属性的用法的信息,您必须参考该模块的文档。可以找到您提到的sys模块


有关
dir()
命令的详细信息,您可以阅读文档。

为什么不键入
sys.call\u tracing
sys.callstats
或shell中列表中的任何内容来查看它们的类型?如果它是一个函数。您将得到类似于