Dear all,
I'm trying to do a script that shows in a table an array of numerical
values.
One little script that shows what I'm trying to do is:
from chimera import runCommand as run
run("sel")
b=[]
for a in chimera.selection.currentAtoms():
b=a.serialNumber
from CGLtk.Table import SortableTable
t=SortableTable(b)
t.addColumn("serial", "Serial", format=None)
t.setData(b)
t.launch()
With this little script I'm trying to show in a column of the table the
serial number of the atoms of my system. But when I execute that, I got a
message in the Python Shell that says:
Traceback (most recent call last):
File "/home/eortega/intento-tabla.py", line 11, in <module>
t=SortableTable(b)
File "CHIMERA/share/CGLtk/Table.py", line 489, in __init__
File "CHIMERA/lib/python2.5/lib-tk/Tkinter.py", line 2442, in __init__
Widget.__init__(self, master, 'frame', cnf, {}, extra)
File "CHIMERA/lib/python2.5/lib-tk/Tkinter.py", line 1923, in __init__
BaseWidget._setup(self, master, cnf)
File "CHIMERA/lib/python2.5/lib-tk/Tkinter.py", line 1901, in _setup
self.tk = master.tk
AttributeError: 'int' object has no attribute 'tk'
And I don't understand it. How can I build successfully my table?
Thank you very much
Best
Elisabeth Ortega
Universitat Autònoma de Barcelona