今天在学习python os模块的system方法时,发现不能赋值给变量,具体操作如下 Screenshot from 2015-09-15 22:45:23   后来查询得知有更新的模块,如下:

os.system
os.spawn*
os.popen*
popen2.*
commands.*

重新使用a = os.popen(‘df -hT’).read()  就能获取到啦。 Screenshot from 2015-09-15 22:50:38