700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > python输出文本和值_Python有没有函数打印当前对象的所有属性和值?_others_酷徒编程知识库...

python输出文本和值_Python有没有函数打印当前对象的所有属性和值?_others_酷徒编程知识库...

时间:2023-07-05 18:31:50

相关推荐

python输出文本和值_Python有没有函数打印当前对象的所有属性和值?_others_酷徒编程知识库...

你可以使用"dir()"函数来执行这个操作。>>> import sys

>>> dir(sys)

['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', '__stdin__', '__stdo

t__', '_current_frames', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder

, 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'exc_clear', 'exc_info'

'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getcheckinterval', 'getdefault

ncoding', 'getfilesystemencoding', 'getrecursionlimit', 'getrefcount', 'getwindowsversion', 'he

version', 'maxint', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_

ache', 'platform', 'prefix', 'ps1', 'ps2', 'setcheckinterval', 'setprofile', 'setrecursionlimit

, 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoption

', 'winver']

>>>

>>> help(sys)

Help on built-in module sys:

NAME

sys

FILE

(built-in)

MODULE DOCS

/doc/current/lib/module-sys.html

DESCRIPTION

This module provides access to some objects used or maintained by the

interpreter and to functions that interact strongly with the interpreter.

Dynamic objects:

argv -- command line arguments; argv[0] is the script pathname if known

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。