How python executes commands under linux and windows

windows下:
import os
cmdres= os.popen("ping baidu.com").read()
print cmdres.decode("gbk")

linux下:

import os
os.system("ls /").read()

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326310099&siteId=291194637