python之sys模块 与 OS模块
可以通过 dir() 方法查看模块中可用的方法. 结果如下, 很多我都没有用过, 所以只是简单介绍几个自己用过的方法. $ python Python 2.7 .6 (default, Oct 26 2016 , 20 : 30 : 19 ) [GCC 4.8 .4 ] on linux2 Type "help" , "copyright" , "credits" or "license" for more information. >>> import sys >>> dir(sys) [ '__displayhook__' , '__doc__' , '__excepthook__' , '__name__' , '__package__' , '__stderr__' , '__stdin__' , '__stdout__' , '_clear_type_cache' , '_current_frames' , '_getframe' , '_mercurial' , '_multiarch' , 'api_version' , 'argv' , 'builtin_module_names' , 'byteorder' , 'call_tracing' , 'callstats' , 'copyright' , 'displayhook' , 'dont_write