title: Unable to read file
body: <p>Why can I not read what I have just written to the text file. The code does not show any errors but I am not able to read what I just wrote to the document. If someone could help me figure this out that would be great. I am new to programming by the way so forgive me if this is a simple problem.I am using Python version 2.6.1</p>
  
  <pre><code>from sys import argv
  
  script,file_name = argv
  prompt = "&gt; "
  
  target = open(file_name, 'w+b')
  
  print "press CRTL-C enter to escape this"
  print "or press RETURN to continue"
  
  raw_input(prompt)
  
  print "Begin erasing stuff Goodbye!"
  target.truncate()
  
  print "we are going to start writing to file"
  
  write_1 = raw_input(prompt)
  write_2 = raw_input(prompt)
  write_3 = raw_input(prompt)
  
  target.write(write_1)
  target.write(write_2)
  target.write(write_3)
  
  print target.read()
  
  
  print "closing now!"
  target.close()
  </code></pre>