title: Python two-dimensional list: exporting as delimited text file
body: <p>I have a 2-D list, myList[r][c], where there are <code>r</code> rows of <code>c</code> columns each.</p>
  
  <p>I am trying to export it into a text file, with each of the column elements delimited by pipes | , and an ampersand &amp; at the end of each row.</p>
  
  <pre><code>myList = [[[] for a in range(c)] for b in range(r)]
  
  {a bunch of code populating  myList}
  
  f = open("myfile.txt","w")
  for x in range(0,r):
      thisRow = ''
       for y in range(0,c):
            appendThis = myList[x][y]
            thisRow += appendThis + "|"
       f.write(thisRow)
       f.write("&amp;")
  f.close
  </code></pre>
  
  <p>...but I get <code>TypeError: can only concatenate list (not "str") to list</code> on the line where I add the pipe character.</p>