title: How to input without newline in Python?
body: <p>I am trying to create a simple file editor in Python via the console (called PyCons). Here is my current program:</p>
  
  <pre><code>def PyCons(f):
    file = open(f, "r")
    appe = open(f, "a")
    print("\n=====\nPyCons Editor, v1.2\nPython 3.6.1\n")
    global i
    i = 0
    for line in file:
      i += 1
      print(" {}|  ".format(i) + line, end='')
    for k in range(10000000000000):
      print("\n {}| ".format(i+1), end='')
      inp = input("")
      if inp == "@PyCons.save()":
        print("\n=====")
        break
      else:
        i += 1
        appe.write("\n" + inp)
  </code></pre>
  
  <p>I used the <code>end</code> method to make sure that the existing code in the file was printed properly in its line format, but the <code>input</code> function does not have an <code>end</code> attribute. So, when I go to enter code in the editor:</p>
  
  <pre><code>PyCons("magic.html")    
  ...
  
  =====
  PyCons Editor, v1.2
  Python 3.6.1
  
   1|  &lt;p&gt;Hello!&lt;/p&gt;
   2|  &lt;h1&gt;Big text!&lt;/h1&gt;
   3|  &lt;h2&gt;Smaller text!&lt;/h2&gt;
  #Should be no spaces here
   4|  &lt;p&gt;More stuff!&lt;/p&gt;
  #No spaces here either
   5|  @PyCons.save()
  
  =====
  </code></pre>
  
  <p>...I get those big, nasty spaces between my inputs. Does anybody know a way to suppress the output of this space, similar to the <code>end=''</code> method used for the <code>print function</code>?</p>
  
  <p>EDIT: Project location for reference: <a href="https://repl.it/@xMikee/File-Editing" rel="nofollow noreferrer">https://repl.it/@xMikee/File-Editing</a></p>