-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTABLE.py
More file actions
26 lines (23 loc) · 710 Bytes
/
Copy pathTABLE.py
File metadata and controls
26 lines (23 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import tkinter as tk
from pandastable import Table
import pandas as pd
class PandasTable:
def __init__(self, frame, height, width):
self.frame = tk.Frame(frame)
self.frame.pack(padx=10, pady=10)
self.df = pd.DataFrame(dict())
self.table = Table(
self.frame,
dataframe=self.df,
showtoolbar=True,
showstatusbar=False,
height=height,
width=width,
editable=False,
enable_menus=False,
)
self.table.show()
def insert_row(self, data):
self.df = self.df._append(data, ignore_index=True)
self.table.model.df = self.df
# self.table.redraw()