Python执行shell命令的几种方式笔记

1.使用os.system执行 import os os.system('pwd') 输出内容:/home/hadoop os.system('cat chinese.txt') 输出内容:中文 2.使用os.popen执行(打开命令管道) import os output = os.popen('cat chinese.txt') print output
相关文章
相关标签/搜索