How to place the value of an input inside a "cell" of a SQLITE3 table, with Python?

Asked

Viewed 62 times

0

Hello, I’m a beginner in programming and, learning about the SQLITE3 library, in Python, I came across a problem and even after a lot of research I did not find the solution. I would like to be able to record in the table a value referring to only one cell of the table, and not the Row whole. For this, I would have to indicate the column and id of the Row, right?

Here is the code (table, cursor, connect, everything is already done in the code):

def data_entry():
  paciente = str(input('NOME DO PACIENTE = ')).lower()
  dia = str(input('DIA = '))
  horario = str(input('HORÁRIO = '))
  cursor.execute('INSERT INTO agendajulho {} ({}) VALUES (?)'.format(dia, horario), (paciente))
  connect.commit()

Anyway, if you could help me, I’d be very grateful.

1 answer

0

  • Wow, like I’ve never found this content before hahaha. It really is quite complete. Thank you so much!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.