title: Read csv file from python
body: <p>I had some data in excel file. I changed the file to .csv file and tried to write some python code to read the file.</p>
  
  <p>But I am getting some unpredictable outputs.  My Code is like this:</p>
  
  <pre><code>INPUT_DIR = os.path.join(os.getcwd(),"Input")
  OUTPUT_DIR = os.path.join(os.getcwd(),"Output")
  print INPUT_DIR, OUTPUT_DIR 
  
  def read_csv():    
      files = os.listdir(INPUT_DIR)
      for file in files:
          file_full_name = os.path.join(INPUT_DIR,file)
          print file_full_name
          f = open(file_full_name,'r')
          for line in f.readlines():
              print "Line: ", line
  
  def create_sql_file():
      print "Hi"
  
  
  if __name__ == '__main__':
      read_csv()
      create_sql_file()
  </code></pre>
  
  <p>This gives very peculiar output:</p>
  
  <pre><code> C:\calcWorkspace\13.1.1.0\PythonTest\src\Input C:\calcWorkspace\13.1.1.0\PythonTest\src\Output
  C:\calcWorkspace\13.1.1.0\PythonTest\src\Input\Country Risk System Priority Data_01232013 - Copy.csv
  Line:  PK**
  </code></pre>
  
  <p>Does someone know of this issue?</p>