-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper_func.py
More file actions
35 lines (31 loc) · 1.01 KB
/
helper_func.py
File metadata and controls
35 lines (31 loc) · 1.01 KB
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
27
28
29
30
31
32
33
34
35
import wx
import wx.grid
from connect import *
from frames import *
from os import popen
class Table(wx.grid.GridTableBase):
def __init__(self, head, body, changeable):
super(Table, self).__init__()
self.head = head
self.body = body
self.changeable = changeable
def GetNumberRows(self):
return len(self.body)
def GetNumberCols(self):
return len(self.head)
def GetValue(self, row, col):
return self.body[row][col]
def GetColLabelValue(self, col):
return self.head[col]
def SetValue(self, row, col, value):
if self.changeable:
self.body[row][col] = value
else:
return
def get_input()->str:
return popen('python read.py').readlines()[0]
def get_item(col_names)->str:
return popen('python readItem.py "'+','.join(col_names)+'"').readlines()[0]
def mod_item(col_names,data)->str:
s='python modItem.py '+','.join(col_names)+' "'+','.join([str(x)for x in data])+'"'
return popen(s).readlines()[0]