diff --git a/1ano/2semestre/labi/tema02/src/Calculater/aritmetica.py b/1ano/2semestre/labi/tema02/src/Calculator/aritmetica.py similarity index 100% rename from 1ano/2semestre/labi/tema02/src/Calculater/aritmetica.py rename to 1ano/2semestre/labi/tema02/src/Calculator/aritmetica.py diff --git a/1ano/2semestre/labi/tema02/src/Calculater/calculadora.py b/1ano/2semestre/labi/tema02/src/Calculator/calculadora.py similarity index 100% rename from 1ano/2semestre/labi/tema02/src/Calculater/calculadora.py rename to 1ano/2semestre/labi/tema02/src/Calculator/calculadora.py diff --git a/1ano/2semestre/labi/tema02/src/Calculater/test_funcionais.py b/1ano/2semestre/labi/tema02/src/Calculator/test_funcionais.py similarity index 100% rename from 1ano/2semestre/labi/tema02/src/Calculater/test_funcionais.py rename to 1ano/2semestre/labi/tema02/src/Calculator/test_funcionais.py diff --git a/1ano/2semestre/labi/tema02/src/Calculater/test_unitarios.py b/1ano/2semestre/labi/tema02/src/Calculator/test_unitarios.py similarity index 100% rename from 1ano/2semestre/labi/tema02/src/Calculater/test_unitarios.py rename to 1ano/2semestre/labi/tema02/src/Calculator/test_unitarios.py diff --git a/1ano/2semestre/labi/tema06/src/database.db b/1ano/2semestre/labi/tema06/src/database.db new file mode 100644 index 0000000..d26bf79 Binary files /dev/null and b/1ano/2semestre/labi/tema06/src/database.db differ diff --git a/1ano/2semestre/labi/tema06/src/database.py b/1ano/2semestre/labi/tema06/src/database.py new file mode 100644 index 0000000..8682296 --- /dev/null +++ b/1ano/2semestre/labi/tema06/src/database.py @@ -0,0 +1,27 @@ +import sqlite3 as sql +import sys + + +def main(args=None): + db = sql.connect('database.db') + + result = db.execute('SELECT * FROM contacts') + rows = result.fetchall() + for row in rows: + print(row) + + for row in rows: + print(row[0], row[1], row[2]) + + print() + try: + result = db.execute('SELECT * FROM contacts WHERE first_name LIKE ?', (args[0],)) + print(result.fetchall()[0][4]) + except IndexError: + print('Contact not found') + + db.close() + + +if __name__ == '__main__': + main(sys.argv[1:])