(self, filename)
return dictdata
Import table data from a comma separated file and create data for a model.
Import table data from a comma separated file and create data for a model.
Import table data from a comma separated file and create data for a model .
def ImportTableModel(self, filename):
        """Import table data from a comma separated file and create data for a model."""

        if not os.path.isfile(filename):
            return None
        try:
            sep = self.var_sep.get()
        except:
            sep = ','
        #takes first row as field names
        dictreader = csv.DictReader(open(filename, "r"), delimiter=sep)
        dictdata = {}
        count=0
        for rec in dictreader:
            dictdata[count]=rec
            count=count+1
        return dictdata
def ImportTableModel ( self , filename ) : if not os . path . isfile ( filename ) : return None try : sep = self . var_sep . get ( ) except : sep = ',' #takes first row as field names dictreader = csv . DictReader ( open ( filename , "r" ) , delimiter = sep ) dictdata = { } count = 0 for rec in dictreader : dictdata [ count ] = rec count = count + 1 return dictdata