51Testing软件测试论坛

标题: python 的 sys 模块学习 [打印本页]

作者: 素简生香    时间: 2017-11-24 14:13
标题: python 的 sys 模块学习
Python 的系统接口模块 sys,负责对于运行时环境信息的获取。以下是一些常用的 sys 的属性和方法:
1.sys.argv 输出所有的命令行参数的列表;
2.sys.stdin.readline() 从标准输入读一行;
3.sys.stdout.write("bwf") 向屏幕输出bwf;
4.sys.modules 系统中所有可用module的字典;
5.sys.platform 运行的操作系统环境;
6.sys.path 所有查找module,package的路径列表;

代码示例以及运行测试在附件里


作者: 梦想家    时间: 2017-11-24 15:15
支持分享   
作者: XYUNHU    时间: 2020-3-6 20:44
能看吗
作者: Miss_love    时间: 2020-12-30 14:49
支持下
作者: ceshiba    时间: 2022-1-12 15:28
good
作者: bsackk    时间: 2022-4-8 11:52
支持分享   




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2