This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
class Grid(object): | |
'''Parses a csv file into a grid. Each cell in the grid is a list of strings, corresponding to | |
the string that was in the corresponding cell in the spreadsheet split by the given | |
'cell_item_separator', which defaults to a comma''' | |
def __init__(self, csv_text, width=0, height=0, cell_item_separator=','): | |
lines = list(csv.reader(csv_text.splitlines())) | |
self.height = height if height > 0 else len(lines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
class Grid(object): | |
'''Parses a csv file into a grid. Each cell in the grid is a list of strings, corresponding to | |
the string that was in the corresponding cell in the spreadsheet split by the given | |
'cell_item_separator', which defaults to a comma''' | |
def __init__(self, csv_text, width=0, height=0, cell_item_separator=','): | |
lines = list(csv.reader(csv_text.splitlines())) | |
self.height = height if height > 0 else len(lines) |