android - Python - How to hide output after killed specified process -


Now I try to create a Python script to automatically get Android logos from

Below Secureon is my share of code

  logcat_process = subprocess.Popen ('adb logcat -v time & gt; logcat.log', shell = true) time.sleep (5) os.kill   

However, every time after the os.kill process has expired, it is

  "" (  

Does anyone have any idea how to hide this message?

I'm more likely to print the result of the script more clearly ....

You can do something like this:

  logcat_process = subprocess.Popen ('adb logcat -v time & gt; logcat.log', shell = true) time.sleep (5) Save_stdout = Sys.stdout sys.stdout = open (r '/ youlib .... / trash.txt', 'w') os.kill ((logcat_process.pid) +1 signal, SIGKILL) # To retrieve the studio Sys.stdout.close () sys.stdout = save_stdout   

This will divert the feed out to trash.txt on operation .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -