title: taking multiline input with sys.stdin
body: <p>I have the following function:</p>
  
  <pre><code>def getInput():
      # define buffer (list of lines)
      buffer = []
      run = True
      while run:
          # loop through each line of user input, adding it to buffer
          for line in sys.stdin.readlines():
              if line == 'quit\n':
                  run = False
              else:
                  buffer.append(line.replace('\n',''))
      # return list of lines
      return buffer
  </code></pre>
  
  <p>which is called in my function takeCommands(), which is called to actually run my program.</p>
  
  <p>However, this doesn't do anything. I'm hoping to add each line to an array, and once a line == 'quit' it stops taking user input. I've tried both <code>for line in sys.stdin.readlines()</code> and <code>for line sys.stdin</code>, but neither of them register any of my input (I'm running it in Windows Command Prompt). Any ideas? Thanks</p>