title: concatenate elements of list with PIPE Delimiter
body: <p>I require help on the below code.
  The code does the following.</p>
  
  <p>Execute the sql query , the output of the sql query is mix of strings,int and date. 
  ie</p>
  
  <pre><code>10001,New York,Corp,1,20151001
  10002,New York,Corp,1,20151001
  </code></pre>
  
  <p>etc.</p>
  
  <p>The expectation is that want to concatenate each record of the sql output and write to a file.</p>
  
  <pre><code>10001|New York|Corp|1|20151001\n
  10002|New York|Corp|1|20151001\n
  </code></pre>
  
  <p>Below is the code.</p>
  
  <pre><code>import cx_Oracle
  import os
  
  result = cur.execute(qry)  # -&gt; Execute the sql query.
  le.extend(result)
  
  # The output of le is like this , le -&gt; type list
  
  le = [(10001,u'New York','Corp',1,20151001),(10002,u'New York','Corp',1,20151001)]
  
  final_data = []
  final_data.extend('|'.join(w) for w in le)
  </code></pre>
  
  <p>Getting error from the above statement.</p>
  
  <pre><code>TypeError: sequence item 1: expected string or Unicode, int found
  </code></pre>
  
  <p>I tried this</p>
  
  <pre><code>final_data.extend('|'.join(str(w)) for w in le)
  </code></pre>
  
  <p>but not getting the desired output, <code>10001|New York|Corp|1|20151001\n</code></p>
  
  <p>Highly appreciate if any help on this.</p>
  
  <p>Thanks,
  Bala</p>