shell - in python, get the output of system command as a string ...

shell - in python, get the output of system command as a string ...

瀏覽:797
日期:2025-07-09
Use os.popen() : tmp = os.popen("ls").read(). The newer way (> python 2.6) to do this is to use subprocess : proc = subprocess.Popen('ls' ......看更多