3

The code was run as:

u = subprocess.Popen(['process','abc','def','','ghi','jkl'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

It doesn't work below due to an error occurred:

ValueError: I/O operation on closed file
RAM
  • 2,413
  • 1
  • 21
  • 33

1 Answers1

1

I suggest you to try pexpect, it is far more well-suited for this tasks (actually, it is a tool built for these kind of tasks).

You can also browse througn examples and see what its usage looks like.

artyom
  • 2,390
  • 2
  • 16
  • 18