plcopen/structures.py
changeset 2441 c553769a65af
parent 1878 fb73a6b6622d
child 2448 1367b796e129
equal deleted inserted replaced
2440:45b43f275ca1 2441:c553769a65af
   102 
   102 
   103 def csv_file_to_table(file):
   103 def csv_file_to_table(file):
   104     """
   104     """
   105     take a .csv file and translate it it a "csv_table"
   105     take a .csv file and translate it it a "csv_table"
   106     """
   106     """
   107     return [map(string.strip, line.split(';')) for line in file.xreadlines()]
   107     return [map(string.strip, line.split(';')) for line in file.readlines()]
   108 
   108 
   109 
   109 
   110 def find_section(section_name, table):
   110 def find_section(section_name, table):
   111     """
   111     """
   112     seek into the csv table to a section ( section_name match 1st field )
   112     seek into the csv table to a section ( section_name match 1st field )