Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1034707
  • 博文数量: 239
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 3618
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-12 13:17
文章分类

全部博文(239)

文章存档

2021年(1)

2016年(1)

2015年(30)

2014年(91)

2013年(116)

发布时间: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:文件系统      容量  已用  可用 .........【阅读全文】

阅读(644) | 评论(0) | 转发(0)

发布时间: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.........【阅读全文】

阅读(1223) | 评论(0) | 转发(0)

发布时间: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".........【阅读全文】

阅读(1205) | 评论(0) | 转发(0)

发布时间: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.........【阅读全文】

阅读(1563) | 评论(0) | 转发(0)

发布时间:2014-02-12 16:59:51

1.从用户那里得到输入最容易的方法就是使用raw_input函数,[root@oracle11g ~]# pythonPython 2.6.6 (r266:84292, May  1 2012, 13:52:17) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> user = raw_input('Enter login nam.........【阅读全文】

阅读(1104) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册