I am trying to make it so I can compare what the user enters as name and space with what is already on the database. If it is there it doesn't enter the users name and space, but if it isn't there it does enter the users name and space on a new row. But I cant get it to work.
This is my code so far:
name = entry2.get()
space = entry3.get()
file1 = open("database.csv", 'r')
lines = file1.read()
with open("database.csv", 'a+', newline='') as fp:
if name or space in lines:
print("No")
elif:
writer = csv.writer(fp)
writer.writerow([name, '9:00am-10:00am', space])
Any help would be much appreciated.