i am trying to send some data from a gui i am working on to python. what i want to do ist write a row (gui) to a list (python) or something similar... (directly to a numpy array would be the best)...
my gui has a table widget i created in the QtDesigner i have a python program building this gui:
from PyQt4 import QtGui, QtCore
from Main_window import Ui_Dialog as Dlg
class MyDia(QtGui.QDialog, Dlg):
def __init__(self):
QtGui.QDialog.__init__(self)
self.setupUi(self)
...
self.tableWidget.cellChanged.connect(self.cellchanged) #connects a signal when
#value in cell should be updated
def cellchanged(self):
col=self.tableWidget.currentColumn()
row=self.tableWidget.currentRow()
text = self.tableWidget.currentItem().text()
list=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
list[col]=text
...
this is my idea - i want the list (or array) to be updated/changed when the user has has changed the entry of a cell. I have only one row so it does not have to be a 2D array.
I need this cause i am sending an array to my actual calculation program where "list" is an input:
... exec(open("./calculation.py").read())
or
... from calculator import calc
calc(list)
i hope someone can help me with this...
spyderlib.widgets.arrayeditor
to do this. – HYRY Dec 7 '13 at 23:03