We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import flet as ft import sqlite3
def fetch_data(table_name): connection = sqlite3.connect('post_office.db') cursor = connection.cursor() cursor.execute(f"SELECT * FROM {table_name}") rows = cursor.fetchall() cursor.execute(f"PRAGMA table_info({table_name})") columns_info = cursor.fetchall() column_names = [col[1] for col in columns_info] connection.close() return column_names, rows
def add_customer(initials, adress, phone, email): connection = sqlite3.connect('post_office.db') cursor = connection.cursor() cursor.execute("INSERT INTO Customers (Initials, Adress, Phone, Email) VALUES (?, ?, ?, ?)", (initials, adress, phone, email)) connection.commit() connection.close()
def main(page: ft.Page): page.title = "Post Office Management System" page.bgcolor = '#ebebeb' page.window_maximized = True
initials = ft.TextField(label="Initials") adress = ft.TextField(label="Adress") phone = ft.TextField(label="Phone") email = ft.TextField(label="Email") add_customer_button = ft.Button(text="Add Customer", on_click=lambda e: add_customer( initials.value, adress.value, phone.value, email.value)) page.add(initials, adress, phone, email, add_customer_button) page.run()
ft.app(target=main) when I run the code, nothing happens and so with any code where there is import flet as ft
The text was updated successfully, but these errors were encountered:
No branches or pull requests
import flet as ft
import sqlite3
def fetch_data(table_name):
connection = sqlite3.connect('post_office.db')
cursor = connection.cursor()
cursor.execute(f"SELECT * FROM {table_name}")
rows = cursor.fetchall()
cursor.execute(f"PRAGMA table_info({table_name})")
columns_info = cursor.fetchall()
column_names = [col[1] for col in columns_info]
connection.close()
return column_names, rows
def add_customer(initials, adress, phone, email):
connection = sqlite3.connect('post_office.db')
cursor = connection.cursor()
cursor.execute("INSERT INTO Customers (Initials, Adress, Phone, Email) VALUES (?, ?, ?, ?)",
(initials, adress, phone, email))
connection.commit()
connection.close()
def main(page: ft.Page):
page.title = "Post Office Management System"
page.bgcolor = '#ebebeb'
page.window_maximized = True
ft.app(target=main)
when I run the code, nothing happens and so with any code where there is import flet as ft
The text was updated successfully, but these errors were encountered: