title: Python create_csv error
body: <p>I have an error for the following when i tried to save the file into csv directly.</p>
  
  <p><img src="https://i.stack.imgur.com/Isdmy.jpg" alt="enter image description here"></p>
  
  <p>Code for C# program :</p>
  
  <pre><code>Process p5 = new Process();
  p5.StartInfo = new ProcessStartInfo("cmd.exe", @"create_csv.py ../../database/gender/&gt; ../genderlist.csv");
  
  p5.Start(); 
  </code></pre>
  
  <p>I am using Python script called create_csv to create a csv file directly.</p>
  
  <p>create_csv :</p>
  
  <pre><code>#!/usr/bin/env python
  
  import sys
  import os.path
  
  # This is a tiny script to help you creating a CSV file from a face
  # database with a similar hierarchie:
  #
  #  philipp@mango:~/facerec/data/at$ tree
  #  .
  #  |-- README
  #  |-- s1
  #  |   |-- 1.pgm
  #  |   |-- ...
  #  |   |-- 10.pgm
  #  |-- s2
  #  |   |-- 1.pgm
  #  |   |-- ...
  #  |   |-- 10.pgm
  #  ...
  #  |-- s40
  #  |   |-- 1.pgm
  #  |   |-- ...
  #  |   |-- 10.pgm
  #
  
  if __name__ == "__main__":
  
      if len(sys.argv) != 2:
          print "usage: create_csv &lt;base_path&gt;"
          sys.exit(1)
  
      BASE_PATH=sys.argv[1]
      SEPARATOR=";"
  
      label = 0
      for dirname, dirnames, filenames in os.walk(BASE_PATH):
          for subdirname in dirnames:
              subject_path = os.path.join(dirname, subdirname)
              for filename in os.listdir(subject_path):
                  abs_path = "%s/%s" % (subject_path, filename)
                  print "%s%s%d" % (abs_path, SEPARATOR, label)
              label = label + 1
  </code></pre>