在Python程序中执行linux命令

import commands
print commands.getstatusoutput('ls')

输出:

(0, '1.py\nwork.nfs')

参考文档:

https://blog.csdn.net/anshejd70787/article/details/101491324

--END-- 10:21

 

posted @ 2020-01-09 09:22  逆火狂飙  阅读(1317)  评论(0)    收藏  举报
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东