title: What should I have done to read these kind of input?
body: <p>I am trying to recreate slippy.
  My code won't stop printing the sequence  after giving the command to stop at the number where the number ends with &quot;seq 10 15 | python3 slippy '/.1/q'&quot;</p>
  <p>My main objective is my code need to recognise q at the end of line and the number with it and should stop printing the sequence after that line number</p>
  <p>For ex - seq 10 15 | python3 slippy '5q'&quot; --&gt; this means stop printing at 5th line.</p>
  <p>Now I am trying to stop printing when the number from the sequence mathces any number which ends with 1</p>
  <pre><code>   Ex - seq 8 15 | python3 slippy '/.1/q'&quot; -&gt; means print the sequence until it reaches 11(as the numbers 2nd digit is 1)
  </code></pre>
  <p>q stands for quit the program when it reaches the target</p>
  <pre><code>import sys
  
  slippy_commnad = sys.argv[1]
  
  line_number = 0
  while True:
      line = sys.stdin.readline()
      line_number += 1
      if line == '':
          break
      print(line, end = '')
      if slippy_commnad[-1] == 'q':
          address = int(slippy_commnad[0:-1])
          # print(address)
          if line_number == address:
              break
      
  </code></pre>