You are reading an old version of the documentation (v2.0.2). For the latest version see


This Page

user_interfaces example code: rec_edit_gtk_simple.pyΒΆ

[source code]

Load a CSV file into a record array and edit it in a gtk treeview

import gtk
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.cbook as cbook
import mpl_toolkits.gtktools as gtktools

datafile = cbook.get_sample_data('demodata.csv', asfileobj=False)
r = mlab.csv2rec(datafile, converterd={'weekdays': str})

liststore, treeview, win = gtktools.edit_recarray(r)
win.set_title('click to edit')
win.connect('delete-event', lambda *args: gtk.main_quit())

Keywords: python, matplotlib, pylab, example, codex (see Search examples)