【发布时间】:2019-06-05 19:13:26
【问题描述】:
我试过了
a = subprocess.run(['apt download timeshhhh'],stdout = subprocess.PIPE, shell = True)
但这表明:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Unable to locate package timeshhhh
我只想要:
E: Unable to locate package timeshhhh
怎么办?
【问题讨论】:
-
在换行符处拆分并捕获最后一项。
-
您的问题标题与正文不符。 “不通过python显示输出”与只想看到最后一行不同。
标签: python linux python-3.x command-line terminal