python - Program freezes trying to read subprocess' stdout -


i have program, makes screenshots , uploads them server, printing link ss afterwards.

output that:

######################################################################## 100,0% https://puu.sh/vce2l/533ecb687d.png 
  • first line behaves loading bar , uses stderr stream.

  • second line stdout link retrieve.

so i'm writing script like:

p = subprocess.popen(['puush', '-a'],stdout=subprocess.pipe, stderr=subprocess.pipe) out, err = p.communicate() 

script freezes on communicate(), if puush program terminates when use terminal.

when do:

p = subprocess.popen(['puush', '-a'],stdout=subprocess.pipe, stderr=subprocess.pipe) p.wait() print('here') 

i see process being terminated normally.

i thankful if give me hint.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -