我尝试过
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
做什么?
答案 0 :(得分:0)
这是stderr
的输出,您没有重定向。如果您不想看到它,可以将其重定向到DEVNULL
。
a = subprocess.run(['apt download timeshhhh'],stdout = subprocess.PIPE, stderr = subprocess.DEVNULL, shell = True)