I want to divide the process when it is err as a result of command execution "communicate ()" in subprocess.
Do you feel like using if statements?
Thanks for your support.
* The following example is intentionally set to "err".
import subprocess p1 = subprocess.Popen (['ping','test'], stdout = subprocess.PIPE, stderr = subprocess.PIPE) out, err = p1.communicate () print (out) print (err) ### Output result ### b'' b'ping: test: \ xe5 \ x90 \ x8d \ xe5 \ x89 \ x8d \ xe3 \ x81 \ xbe \ xe3 \ x81 \ x9f \ xe3 \ x81 \ xaf \ xe3 \ x82 \ xb5 \ xe3 \ x83 \ xbc \ xe3 \ x83 \ x93 \ xe3 \ x82 \ xb9 \ xe3 \ x81 \ x8c \ xe4 \ xb8 \ x8d \ xe6 \ x98 \ x8e \ xe3 \ x81 \ xa7 \ xe3 \ x81 \ x99 \ n'
Answer # 1
if p1.returncode>0:Is not it.
- how to save the image ocr result file in python
- questions about the run command in python
- python 3x - the output result of the numerical value obtained by web scraping becomes 0
- python - when using the cv2adaptivethreshold function in the binarization process of an image, an error occurs in medianblur and
- python - i want to display the scraping result in the browser
- excel python i want to get the display result instead of the conditional statement
- python - i want to get the same result as assigning a variable and writing it directly in a function
- python - i want to divide the read image into pixels and label them
- about for syntax i want to know the reason why the result is different depending on where the initial value is defined python
- python - delete bom on the command line
- (python) input () if time elapses without input, skip input () and move to the next process what can i do?
- python - i want to restore the result of calculating the inner product with numpy
- python - discord bot command cannot be started
- python - please tell me the solution of gunicorn: command not found when deploying heroku (crying)
- i want to output the entry result of tkinter with python
- i want to start the next process when the first process starts in python
- please tell me how to write a program to end when the result is executed 5 times [python]
- i want to wait until the next process can be performed after executing the process in python
- python - i don't know how to process blocking processes in parallel