Execute a command and get its results using python in Linux
import commands
result = commands.getoutput("ls")
Byte sized tech know-how.
Execute a command and get its results using python in Linux
import commands
result = commands.getoutput("ls")
Copyright © 2024 Txt
you could also use
import os
os.system(“ls”)
yields the same results…