<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> </head>Thanks for your reply.<br/><br/>Unfortunately I can't change the data format because it is output from a closed source app.<br/><br/>I can't figure out a way to create the entry widgets on the fly because they need to be bound to a variable to attach them to a gtk.Table and to be able to read the data from them<br/><br/>Bodsda <p>Sent from my BlackBerry® wireless device</p><hr/><div><b>From: </b> Walter Prins &lt;wprins@gmail.com&gt;
</div><div><b>Date: </b>Tue, 26 Apr 2011 16:55:36 +0100</div><div><b>To: </b>&lt;bodsda@googlemail.com&gt;</div><div><b>Cc: </b>&lt;tutor@python.org&gt;</div><div><b>Subject: </b>Re: [Tutor] Gtk - relational data display and edit</div><div><br/></div><br><br><div class="gmail_quote">On 26 April 2011 16:34,  <span dir="ltr">&lt;<a href="mailto:bodsda@googlemail.com">bodsda@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I am reading in data from a csv file which will be in a format like this<br>
<br>
User1, attrib1, attrib2<br>
User2, attrib1, attrib2<br>
Etc.<br></blockquote><div><br>Why would the data be in this format?  Are you defining it?  Reason I ask is that, relationally speaking, (e.g. database design-wise) this is a denormalised representation and you&#39;d do better to store a single attribute per record.  E.g. have entities, User, Attrib, and have relationship table User_Attrib that contains only user, attrib pairs.  But, maybe such ideas are overkill for your app.<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

And need to display this in a window. My initial thought was to use gtk.Entry widgets because I will need to edit this data, but I don&#39;t think this will work as I will also need to read the data back, in relation to the user column, e.g I will have something like<br>

<br>
[Psuedocode]<br>
For I in entries:<br>
    A = usercolumn<br>
    B = attrib1column<br>
    C = attrib2column<br>
<br>
    Somefunction(A,B,C)<br>
[/psuedocode]<br>
<br>
I don&#39;t think I could use this method with entry boxes as I have no idea how many entries there will be (column length will be fixed) so I can&#39;t create the entry widgets beforehand<br>
<br>
Anyone have any suggestions?<br></blockquote><div><br>Well if you can count the number of entries on reading the file (whatever the shape of the file) then in principle you can dynamically create the correct number of entry boxes on the fly.  Of course, if you store one attribe per record, then counting the number of attributes (records) for a given user becomes quite easy of course. But even if you don&#39;t do this, and you have the file structure you described, you can code reader code that would internally store the attributes and the number of attributes for each user, enabling you to write code to create the UI with the appropriate number of entry widgets.  <br>
<br>Walter<br></div></div><br>

</html>