Creating a variable filename for every new file in loop,python
<p>I have been trying to get this code to work for hours. But it just doesn't work, the files are being created. But all that is i'm getting back from the file is stuff which doesn't make sense to me. </p>

<pre><code>x=raw_input()
p=open(str(x) + ".txt", 'w+')
p.write("Test#1")
print p.read();
p.close()
</code></pre>

<p>Some of the ouputs are:</p>

<pre><code>w(name, string='') - Return a new hashing object using the named algorithm;
    optionally initialized with a string.
    N(
</code></pre>