Posted in Code, Linux, Python Get Result of Command using Python in Linux Binny V A October 7, 2007 1 Comment on Get Result of Command using Python in Linux Execute a command and get its results using python in Linux import commands result = commands.getoutput("ls") Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.
you could also use
import os
os.system(“ls”)
yields the same results…