python commands模块
2015-06-16 17:16
711 查看
#!/usr/bin/python #-*- coding:UTF-8 -*- ''' Created on 2015年6月10日 @author: huangpeng03 ''' import commands if __name__ == '__main__': status, output = commands.getstatusoutput('ls') print status print output print type(status) print type(output)
注意 output类型是str而不是list,昨天搞了半天这个以为是个list
console:
0
beanstalk_tst.py
beanstalk_tst.pyc
demo1.py
demo2.py
<type 'int'>
<type 'str'>
相关文章推荐
- 用Python改变文件的MD5码
- beanstalk python操作
- [笔记]Emacs笔记:一,Windows下配置Emacs来开发Python
- Python——字符串变量
- python-day1
- Python学习(五)---使用dict和set
- Python xml属性/节点/文本的增删改[xml.etree.ElementTree]
- python杂记
- Python中range 与 xrange的区别
- Python--ZODB
- 关联规则apriori算法的python实现
- 使用PyInstaller打包Python程序
- BoW图像检索Python实战
- Python split()方法
- python 面向对象
- Python中argv的使用遇到的问题。
- Python 的 urllib
- python替换字符串中的子串 %(xxxx)s
- wxPython写计算器
- python 单实例一个类