Built Table
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good
This commit is contained in:
parent
cbfe80ac1c
commit
446befd788
2
db.json
2
db.json
@ -1 +1 @@
|
||||
{"_default": {"1": {"Serial Number": "123", "Brand": "d", "Grade": "7", "Name": "jb"}}}
|
||||
{"_default": {"1": {"Serial Number": "123", "Brand": "d", "Grade": "7", "Name": "jb"}, "2": {"Serial Number": "1", "Brand": "2", "Grade": "3", "Name": "4"}}}
|
15
main.py
15
main.py
@ -6,8 +6,9 @@ from tinydb import TinyDB, Query
|
||||
|
||||
|
||||
# Define the window's contents
|
||||
layout = [[sg.Menu([['File', ['Open', 'Save', 'Add Computer',]]])],
|
||||
[sg.Table([["word","Yes"]],["Serial Number","Brand","Grade","Name"],key = "table")],
|
||||
colum_lut = ["Serial Number","Brand","Grade","Name"],
|
||||
layout = [[sg.Menu([['File', ['Open', 'Save', 'Add Computer',]]])]
|
||||
[sg.Table([["word","Yes"]],colum_lut,key = "table")],
|
||||
[sg.Text("Serial Number")],
|
||||
[sg.Input(key='Serial Number')],
|
||||
[sg.Text("Brand")],
|
||||
@ -43,8 +44,16 @@ def add_computer():
|
||||
def main():
|
||||
"""Core of ComputerKeeper - The Main Application."""
|
||||
db= TinyDB("./db.json")
|
||||
Computer = []
|
||||
for item in db.all():
|
||||
print(item)
|
||||
The_Device = []
|
||||
for colum in colum_lut:
|
||||
The_Device.append(item[colum])
|
||||
Computer.append(The_Device)
|
||||
# Create the window
|
||||
window = sg.Window('Window Title', layout)
|
||||
window = sg.Window('Window Title', layout, finalize=True)
|
||||
window["table"].update(Computer)
|
||||
|
||||
# Display and interact with the Window using an Event Loop
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user