在python中调用shell命令获得返回值

获得用户名
users = commands.getoutput('echo $USER').strip()

posted @ 2020-08-11 15:44  maxsmile17  阅读(983)  评论(0编辑  收藏  举报