Python: Print just once in raw_function
<pre><code>result = raw_input("Enter results file: ")

while True:
    try:
        result = get_marks_from_file(result)
        break
    except IOError:
        print 'Please supply correct file. '
</code></pre>

<p>Above is the <code>raw_input</code> function that I am using to bring a file. When I put correct file name, it works well. But when I put something else such as <code>'asdsada'</code>, the sentence <code>'please supply correct file. '</code> is printed and it doesn't stop. Is there any method for just one printing and return to the question?</p>

<p>Any advices or helps would be appreciated.</p>
