title: How to send EOF to Python sys.stdin from commandline? CTRL-D doesn't work
body: <p>I am writing to my Python process from the commandline on unix. I want to send EOF (or somehow flush the stdin buffer, so Python can read my input.)</p>
  
  <p>If I hit CTRL-C, I get a KeyboardError.</p>
  
  <p>If I hit CTRL-D, the program just stops.</p>
  
  <p>How do I flush the stdin buffer?</p>