I will start by prefacing that i am a fresher with only university level python experience.
I am trying to get the error code of an os.system(cmd) to my python script.
I know that i should be using subprocess, but in my current scenario i have a limitation of using only os. The issue is that the 404 Not Found is being printed in my console, i just want it to be available for my script.
Here is the os command:
try:
os.system(download_cmd)
I know i cant catch the exception but in the console this is being printed:
HTTP request sent, awaiting response... 404 Not Found
2020-07-16 14:41:03 ERROR 404: Not Found.
I need the text or code 404 Not Found to be used by my script.
Any insight will be helpful. Thanks!