title: I need some help Write random test data to csv file using faker
body: <p>I am new to Python 2.7
  I am trying to write some random test data to a csv file using the Python faker package.
  I have stored a random first name value into a List variable called 'firstNameList' 
  I then write the value to the csv using write_to_csv.writerow(firstNameList)</p>
  
  <p>The value that is written out in the csv file is 
  |('first_name', u'Monica')|</p>
  
  <p>I just want the first name value in the csv e.g. Monica
  I do not want the whole string |('first_name', u'Monica')| in the csv.</p>
  
  <p>I have noticed my other first name variable firstName1 has the value Loraine 
  This one would be great to use.  But when i try to write firstName1 to the csv the output is 
  f i r s t _ n a m e</p>
  
  <p>My code is below.<br>
  I am storing the value in a List variable because i want to populate a few rows in the csv.  Say 100 rows of random data.
  If i store 100 first names into the names list variable I can then use a for loop to loop through the List and output the values to the csv file.
  I will then do the same for address, email, phone etc.</p>
  
  <pre><code>from faker.factory import Factory
  import csv
  
  def writeTo_csv(fake):
      with open('test.csv', 'wb') as csvfile:
      write_to_csv = csv.writer(csvfile, delimiter=' ', quotechar='|',     quoting=csv.QUOTE_MINIMAL)
      write_to_csv.writerow(['id,', 'TITLE,', 'FNAME,', 'SNAME,', 'GENDER,',     'ADD1,', 'ADD2,', 'ADD3,', 'ADD4,', 'PCODE,', 'PHONE,', 'MOBILE,', 'DOB'])
      firstName1 = "first_name"
      firstNameList = [(firstName1, getattr(fake, firstName1)())]
      print "%s = %s" % (firstName1, getattr(fake, firstName1)())
      print firstNameList
      write_to_csv.writerow(firstName1)
  
  if __name__ == "__main__":
  fake = Factory.create('en_GB')
  writeTo_csv(fake)
  </code></pre>