title: Files in python are empty for no reason
body: <p>I have tried to split up my world generation from my actual game, since I usually fail with it. But for some reason it keeps insisting the file is empty/ the variable gained from it is empty, and sometimes, when I look afterwards, the actual program file has emptied the text file with all the info, sometimes not. Here is the code:</p>
  
  <p><a href="https://www.dropbox.com/s/x3tab11mkmbe2xi/PlatformerGame" rel="nofollow">Dropbox Main code</a></p>
  
  <p><a href="https://www.dropbox.com/s/giv63jf1rpukj2h/World%20Generator.py" rel="nofollow">Dropbox World gen</a></p>
  
  <p>Here's a small extract of just the file handling in the main code:</p>
  
  <pre><code>world_file = open("C:\Users\Ben\Documents\Python Files\PlatformerGame Files\World.txt", "r")
  world_file_contents = world_file.read()
  world_file.close()
  world_file_contents = world_file_contents.split("\n")
  WORLD = []
  for data in world_file_contents:
      usable_data = data.split(":")
      WORLD.append(Tile(usable_data[0],usable_data[1]))
  </code></pre>
  
  <p>And the tile class:</p>
  
  <pre><code>class Tile():
      def __init__(self,location,surface):
          self.location = location
          self.surface = surface
  </code></pre>
  
  <p>And the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Ben\Documents\Python Files\PlatformerGame", line 89, in &lt;module&gt;
      Game.__main__()
    File "C:\Users\Ben\Documents\Python Files\PlatformerGame", line 42, in __main__
      WORLD.append(Tile(usable_data[0],usable_data[1]))
  IndexError: list index out of range
  </code></pre>
  
  <p>Sorry if it's obvious. Also I'm using pygame.</p>