发布时间:2014-02-19 00:11:28
[root@oracle11g home]# cat pysysinfo_func_2.py点击(此处)折叠或打开#!/usr/bin/env python#A System Information Gathering Scriptimport subprocess#Command 1def uname_func(): &nbs.........【阅读全文】
发布时间:2014-02-19 00:04:07
这个很简单,只需要>>> import pysysinfoGathering system information with uname command:Linux oracle11g 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/LinuxGathering diskspace information df command:文件系统 容量 已用 可用 .........【阅读全文】
发布时间:2014-02-18 23:56:24
[root@oracle11g home]# cat pysysinfo_func.py #!/usr/bin/env python#A System Information Gathering Scriptimport subprocess#Command 1def uname_func():uname = "uname"uname_arg = "-a"print "Gathering system information with %s command:\n" %unamesubprocess.call([uname,uname_arg])#Com.........【阅读全文】
发布时间:2014-02-18 23:43:49
[root@oracle11g home]# cat pysysinfo.py #!/usr/bin/env python#A System Information Gathering Scriptimport subprocess#Command 1uname = "uname"uname_arg = "-a"print "Gathering system information with %s command:\n" %unamesubprocess.call([uname,uname_arg])#Command 2diskspace = "df".........【阅读全文】
发布时间:2014-02-18 23:35:20
用Python语言封装了一个linux命令,代码如下:[root@oracle11g home]# cat pyls.py #!/usr/bin/env python#Python wrapper for the ls commandimport subprocesssubprocess.call(["ls","-l"])[root@oracle11g home]# ./pyls.py 总用量 12drwx------. 5 oracle oinstall 4096 2月 12 18:11 oracle.........【阅读全文】