python编写poc_干货分享丨Python从入门到编写POC之常用的标准库

Python从入门到编写POC系列文章是i春秋论坛作家「Exp1ore」表哥原创的一套完整教程,想系统学习Python技能的小伙伴,不要错过哦!

常用的标准库

安装完Python之后,我们也同时获得了强大的Python标准库,通过使用这些标准库可以为我们节省大量的时间,这里是一些常用标准库的简单说明。

Python的标准库包括了很多模块,从Python语言自身特定的类型和声明,到一些只用于少数程序的不著名模块,任何大型Python程序都有可能直接或间接地使用到这类模块的大部分内容。

sys模块

咱们之前已经接触过了sys模块,sys.path.append( ),可以通过help命令查看文档,然后不断的回车查看。

或者用这个命令:

>>> print sys.__doc__This module provides access to some objects used or maintained by theinterpreter and to functions that interact strongly with the interpreter.Dynamic objects:argv -- command line arguments; argv[0] is the script pathname if knownpath -- module search path; path[0] is the script directory, else ''modules -- dictionary of loaded modulesdisplayhook -- called to show results in an interactive sessionexcepthook -- called to handle any uncaught exception other than SystemExit To customize printing in an interactive session or to install a custom top-level exception handler, assign other functions to replace these.exitfunc -- if sys.exitfunc exists, this routine is called when Python exits Assigning to sys.exitfunc is deprecated; use the atexit module instead.stdin -- standard input file object; used by raw_input() and input()stdout -- standard output file object; used by the print statementstderr -- standard error object; used for error messages By assigning other file objects (or objects that behave like files) to these, it is possible to redirect all of the interpreter's I/O.last_type -- type of last uncaught exceptionlast_value -- value of last uncaught exceptionlast_traceback -- traceback of last uncaught exception These three are only available in an interactive session after a traceback has been printed.exc_type -- type of exception currently being handledexc_value -- value of exception currently being handledexc_traceback -- traceback of exception currently being handled The function exc_info() should be used instead of these three, because it is thread-safe.Static objects:float_info -- a dict with information about the float inplementation.long_info -- a struct sequence with information about the long implementation.maxint -- the largest supported integer (the smallest is -maxint-1)maxsize -- the largest supported length of containers.maxunicode -- the largest supported characterbuiltin_module_names -- tuple of module names built into this interpreterversion -- the version of this interpreter as a stringversion_info -- version information as a named tuplehexversion -- version information encoded as a single integercopyright -- copyright notice pertaining to this interpreterplatform -- platform identifierexecutable -- absolute path of the executable binary of the Python interpreterprefix -- prefix used to find the Python libraryexec_prefix -- prefix used to find the machine-sp

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值