(self, filename, sep=',')
return
Import table data from a comma separated file.
Import table data from a comma separated file.
Import table data from a comma separated file .
def importCSV(self, filename, sep=','):
        """Import table data from a comma separated file."""

        if not os.path.isfile(filename) or not os.path.exists(filename):
            print ('no such file')
            return None

        #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
        self.importDict(dictdata)
        return
def importCSV ( self , filename , sep = ',' ) : if not os . path . isfile ( filename ) or not os . path . exists ( filename ) : print ( 'no such file' ) return None #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 self . importDict ( dictdata ) return