from my_functions import open_basiccrud_db
from my_functions import close_database
from prettytable import PrettyTable

conn, cursor = open_basiccrud_db()
sql = '''
    SELECT name,age FROM users 
'''
cursor.execute(sql)
data = cursor.fetchall()
table = PrettyTable(['name', 'age'])
for (name, age) in data:
    table.add_row([name, age])
print(table)
close_database(cursor, conn)