Reputation: 938
I tried this
a = subprocess.run(['apt download timeshhhh'],stdout = subprocess.PIPE, shell = True)
but this shows:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Unable to locate package timeshhhh
I want only:
E: Unable to locate package timeshhhh
what to do?
Upvotes: 0
Views: 1121
Reputation: 782056
That's the stderr
output, which you didn't redirect. You can redirect it to DEVNULL
if you don't want to see it.
a = subprocess.run(['apt download timeshhhh'],stdout = subprocess.PIPE, stderr = subprocess.DEVNULL, shell = True)
Upvotes: 2