a guest Dec 9th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def readFile(name, separator=','):
- csvList = 
- with open(name, 'r') as csvFile:
- for line in csvFile.readlines():
- if line.isspace(): continue
- assert len(csvList) == len(csvList[-1]), "Unproper number of column in a row"
- return csvList
- except FileNotFoundError:
- print("File has not found. Please provide correct path")
- def saveFile(file, fileName, separator=','):
- with open(fileName+'_writed.csv','w+') as csvFile:
- for line in file:
- except IndexError:
- print('Probably your list is empty.')
- def main():
- path = 'cities.csv'
- readedFile = readFile(path)
- if __name__ == '__main__':
RAW Paste Data