17

I have the following command run through popen:

p = subprocess.popen(["/usr/bin/whiptail", "--title", "\"Progress\"", "--gauge", "\"\"", "6", "50", "0"], stdout=subprocess.PIPE, stding=subprocess.PIPE)

To stop the whiptail command from running I need to send EOF to stdin.

How do I send EOF to stdin in Python ?

or I just call p.terminate()

gudge
  • 1,053
  • 4
  • 18
  • 33

1 Answers1

24

What you need is to close the file used as standard input for your script.

So in your case it's p.stdin.close().

thule
  • 4,034
  • 21
  • 31