Код: Выделить всё
import csv
def addr():
with open('csvfile.csv','a',newline='') as f:
w=csv.writer(f,delimiter=',')
tid=int(input('Teacher ID: '))
nm=input('Enter Name: ')
mo=int(input('Mobile Number: '))
w.writerow(tid,nm,mo)
def countr():
with open('csvfile.csv') as f:
c=csv.rowcount
print('Number of records:',c)
while True:
addr()
if input('Do you Wish to Continue? (Y/N): ').lower() in ('n','no'):
break
Когда я пытался использовать обычный file.write(), ошибок не было.
Подробнее здесь: https://stackoverflow.com/questions/782 ... g-that-the