title: (Python) Creating a 2d list (map) from a file
body: <p>So I'm trying to get my program to read the elements of a text file then create a 2d list that is 20x30 with the elements of the text file. My expected outcome of this is essentially a game map in which I can find certain elements and move them as need be.</p>
  
  <p>The two functions i have so far for trying to do this are as follows, but I can't seem to get it to do what I want it to do, and I'm kind of stumped as to why I can't.</p>
  
  <pre><code>def create_level(level):
       """ Create the level based off of reading positions of agents, player, buildings
  water, etc..."""
  
       a_maze = []
  
       level_data = level.read()
       for r in range (0, ROWS, 1):
          a_maze.append ([])
          for c in range (0, COLUMNS, 1):
               a_maze[r].append (level_data)
       print(a_maze)
  
  
  
  def load_level():
       while True:
            print("Enter the name/directory of the level file you wish to load\
       .txt or .lvl are the only accepted formats")
  
            level_in = input("&gt;&gt;: ")
            if (level_in.endswith(".txt") or level_in.endswith(".lvl")):
                 try:
                      level = open(level_in, "r")
  
                 except IOError:
                      print("Not a valid file")
            else:
                 print("Not a suitable format for level")
  
            return level
  </code></pre>