How to show the functions and variables in module sys with Python

1 Answer

0 votes
import sys

print(dir(sys))


'''
run:
   
['__displayhook__', '__doc__', '__excepthook__', '__interactivehook__', '__loader__', '__name__',
'__package__', '__spec__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache',
'_current_frames', '_debugmallocstats', '_getframe', '_home', '_mercurial', '_xoptions',
'api_version', 'argv', 'base_exec_prefix', 'base_prefix', 'builtin_module_names', 'byteorder',
'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'dont_write_bytecode',
'exc_info', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info',
'float_repr_style', 'get_coroutine_wrapper', 'getallocatedblocks', 'getcheckinterval',
'getdefaultencoding', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount',
'getsizeof', 'getswitchinterval', 'gettrace', 'getwindowsversion', 'hash_info', 'hexversion',
'implementation', 'int_info', 'intern', 'is_finalizing', 'maxsize', 'maxunicode', 'meta_path',
'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix',
'set_coroutine_wrapper', 'setcheckinterval', 'setprofile', 'setrecursionlimit',
'setswitchinterval', 'settrace', 'stderr', 'stdin', 'stdout', 'thread_info', 'version',
'version_info', 'warnoptions', 'winver']
 
'''

 



answered Jun 27, 2018 by avibootz
...