I am trying to read and write on the same CSV file:
file1 = open(file.csv, \'rb\')
file2 = open(file.csv, \'wb\')
read
import csv
with open(file,"r+") as file:
break
Note: I found that 'write' was affected since the previous value wasn't deleted before adding the next value so it would look something like this(writing='Hello'):
I would suggest this:
def writing(file,'what to write'):
with open(file, "w") as wfile:
break
def reading(file):
with open(file, "r") as rfile:
break