source: waeup/trunk/src/waeup/utils/importexport.py @ 3529

Last change on this file since 3529 was 3529, checked in by adiwidjaja, 16 years ago

Working import/export.

  • Property svn:eol-style set to native
File size: 302 bytes
RevLine 
[3527]1import csv
2
3def readFile(f):
4    """read a CSV file"""
5    headers = []
6    rows = []
7    f = csv.reader(f)
8    headers = f.next()
9    for line in f:
10        rows.append(line)
11    return (headers, rows)
12
13def writeFile(data):
14    writer = csv.writer(open("export.csv", "wb"))
15    writer.writerows(data)
Note: See TracBrowser for help on using the repository browser.