title: Why won't this python code open the file?
body: <p>When I run this code it prompts for the file name, and regardles whether I enter the path to the file, or drag and drop, it will run the except part of the code  <code>'File cannot be opened'</code> but it will never run <code>fuse = open(fname)</code> or the rest of the program.</p>
  
  <p>Here is the complete program:</p>
  
  <pre><code>fname = raw_input('Enter file name: ')
  try:
      fuse = open(fname)
  except:
      print 'File cannot be opened'
      raw_input('Press enter to quit')
  count = 0
  total = 0
  for line in fuse:
      if line.notstartswith('X-DSPAM-Confidence:'): continue
      elif line.startswith('X-DSPAM-Confidence:'):
      count = count + 1
      vpos = line.find(' ')
      addv = line[vpos:]
      addv = float(addv)
      total = total + addv
  
  print total/count
  </code></pre>
  
  <p>Any ideas of what could be wrong?</p>
  
  <p>When I run it without the try and except from the command line to see the error, this is the message I get: </p>
  
  <p>Enter file name: "C:\Users\Gonzalez Cocoma\Documents\Python\Programs\mbox-short.txt"
  Traceback (most recent call last):
    File "C:\Users\Gonzalez Cocoma\Documents\Python\Programs\Spamaverage.py", line 2, in 
      fuse = open(fname)
  IOError: [Errno 22] invalid mode ('r') or filename: '"C:\Users\Gonzalez Cocoma\Documents\Python\Programs\mbox-short.txt"'</p>