Python EOF error when loop
<p>I need to write a python code to print the input like this:</p>

<pre><code>while (True):
    output = raw_input()
    print output
</code></pre>

<p>But when I want to end the loop,I used Ctrl_D,and it says:</p>

<pre><code>  File "./digits.py", line 6, in &lt;module&gt;
    output = raw_input()
  EOFError
</code></pre>

<p>How can I solve it? If possible please give me some simple way because this is the first time I write in python.</p>

<p>Have you considered putting a keyword check in your loop?</p>

<pre><code>while (True):
    output = raw_input()
    if str(output) == "exit":
        break
    print output
</code></pre>

python eoferror