📅  最后修改于: 2022-03-11 14:45:44.502000             🧑  作者: Mango
# code to perform a command line command and store out put in a variable
import subprocess as sp
command = "whoami"
output = sp.getoutput(command)
print(output)