Voodoo Code In Python
<p>I was going through Zed Shaw's Learn Python The Hard Way and something in Chapter 15 struck me. In the extra credit exercises he asks us to delete the latter part of the code [everything after print txt.read() ] and then execute it, but the interpreter behaves as if nothing has happened. Yes, I saved the file and when I modified it by adding print statements then the changes still showed up, but the same voodoo code was executed. Why?</p>

<p>What's going on over here?</p>

<pre><code>from sys import argv

script, filename = argv

txt = open(filename)

print "Here's your file %r:" % filename
print txt.read()

print "I'll also ask you to type it again:"
file_again = raw_input("&gt; ")

txt_again = open(file_again)

print txt_again.read()
</code></pre>
