[wxpython-users] Wx.grid and importing text

giorgio.luciano at inwind.it giorgio.luciano at inwind.it
Tue Apr 1 13:28:21 PDT 2008


Hello to all,
I'm a newbie and even if I've read the book of wxpython and tried to use the help for wxpython I didn't succeed to solve my problem.
I simply would like to import in a grid a txt file but it seems more diffocult than expected.
first of all I would like to ask. Is better to use a pytable for that (I think at maximum I will have grids of 2000x4000) ?
i tried this

import pylab as p
a=p.load('c:/temp/myfile.txt)

self.grid1 = wx.grid.Grid(id=wxID_FRAME1GRID1, name='grid1',
              parent=self.panel4, pos=wx.Point(0, 0), size=wx.Size(728, 264),
              style=0)
        self.grid1.EnableGridLines(True)
        self.grid1.SetHelpText('')
        self.grid1.Bind(wx.grid.EVT_GRID_SELECT_CELL,
              self.OnGrid1GridSelectCell)
        self.grid1.CreateTable(50,50)
#and there I've the problem that boa constructor doesnt' #recognise the code but it runs so it's ok
then which command do I have to use
is there something like setvalue in the txt editor ?

should I manually write some code like
[r,c]=a.size
for i in arange (1,r)
  for k in arage (1,c)
   wx.gri1.Setvalue(i,k)

??
Every help appreciated
Thanks



More information about the wxpython-users mailing list