Major demo refresh.. switched everything to new function names, new design patterns
Out with the old, in with the new!!
This commit is contained in:
parent
2a06683383
commit
a1f4c60271
68 changed files with 706 additions and 1863 deletions
|
@ -1,12 +1,13 @@
|
|||
import pandas as pd
|
||||
import PySimpleGUI as sg
|
||||
import sys
|
||||
|
||||
def table_example():
|
||||
sg.SetOptions(auto_size_buttons=True)
|
||||
filename = sg.PopupGetFile('filename to open', no_window=True, file_types=(("CSV Files", "*.csv"),))
|
||||
# --- populate table with file contents --- #
|
||||
if filename == '':
|
||||
exit(69)
|
||||
sys.exit(69)
|
||||
data = []
|
||||
header_list = []
|
||||
button = sg.PopupYesNo('Does this file have column names already?')
|
||||
|
@ -21,7 +22,7 @@ def table_example():
|
|||
header_list = ['column' + str(x) for x in range(len(data[0]))] # Creates columns names for each column ('column0', 'column1', etc)
|
||||
except:
|
||||
sg.PopupError('Error reading file')
|
||||
exit(69)
|
||||
sys.exit(69)
|
||||
# sg.SetOptions(element_padding=(0, 0))
|
||||
|
||||
col_layout = [[sg.Table(values=data, headings=header_list, display_row_numbers=True,
|
||||
|
@ -30,9 +31,9 @@ def table_example():
|
|||
canvas_size = (13*10*len(header_list), 600) # estimate canvas size - 13 pixels per char * 10 per column * num columns
|
||||
layout = [[sg.Column(col_layout, size=canvas_size, scrollable=True)]]
|
||||
|
||||
form = sg.FlexForm('Table', grab_anywhere=False)
|
||||
b, v = form.LayoutAndRead(layout)
|
||||
window = sg.Window('Table', grab_anywhere=False)
|
||||
b, v = window.LayoutAndRead(layout)
|
||||
|
||||
exit(69)
|
||||
sys.exit(69)
|
||||
|
||||
table_example()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue