user1471980
user1471980

Reputation: 10636

how do you print out errors from curl command

I am trying to use shlex library to run a curl command. I need to print out the errors. I have done the following but I dont see any errors.

import shlex
url='test.com'
args = shlex.split(url)

process = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
print(stderr)

It is not pringing any errors. Any ideas?

Upvotes: 0

Views: 72

Answers (0)

Related Questions