<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:12pt">forwarding to the list.<br><br>Please use Reply All when replying to the <br>list otherwise it is only a reply to the <br>original poster.<br><div>&nbsp;</div>Alan Gauld<br>Author of the Learn To Program website<br><a rel="nofollow" target="_blank" href="http://www.alan-g.me.uk">http://www.alan-g.me.uk/<br></a><div><br></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2">----- Forwarded Message ----<br><b><span style="font-weight: bold;">From:</span></b> Neven Goršić &lt;neven.gorsic@gmail.com&gt;<br><b><span style="font-weight:
 bold;">To:</span></b> Alan Gauld &lt;alan.gauld@btinternet.com&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, 4 April, 2010 22:39:41<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Tutor] Menu data from file<br></font><br>I can not loop over each list item like:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for eachMenuData in self.menuData():<br><br>because when I read external txt file:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f=open(listFile,'r')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lines=f.readlines()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.close()<br><br> I get the list of file lines instead of list of external list (tuple) 
elements.<br>And if I join that in one string (or use read() instead of readlines()) loop<br>goes through every character, again not getting tuple/list elements....<br><br>Neven<br><br>---------------------------------------<br>
<br><br><div class="gmail_quote">On Sun, Apr 4, 2010 at 7:05 PM, Alan Gauld <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:alan.gauld@btinternet.com" target="_blank" href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
"Neven Gorsic" &lt;<a rel="nofollow" ymailto="mailto:neven.gorsic@gmail.com" target="_blank" href="mailto:neven.gorsic@gmail.com">neven.gorsic@gmail.com</a>&gt; wrote<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I would like to import menu data from external txt file, but not as import<br>
menudata.py, because then py2exe makes problems ...<br>
I would like to preserve list structure like:<br>
</blockquote>
<br></div>
Yes that's a good idea.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
 &nbsp; (("File",<br>
 &nbsp; &nbsp; &nbsp;("&amp;New\tCtrl+N", "Create new blank script", self.onNew),<br>
 &nbsp; &nbsp; &nbsp;("&amp;Open\tCtrl+O", "Opens call script", self.onOpen),<br>
 &nbsp; &nbsp; &nbsp;("","",""),<br>
 &nbsp; &nbsp; &nbsp;("&amp;Save\tCtrl+S", "Saves call script", self.onSave),<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; . &nbsp;. &nbsp;.<br>
<br>
Thanks,<br>
</blockquote>
<br></div>
You're welcome.<br>
<br>
Or do you have a problem with implementing it?<br>
If so what? What did you try? What happened?<br>
Oh, and it will help to tell us which GUI toolkit<br>
you are using too?<br>
<br>
<br>
-- <br>
Alan Gauld<br>
Author of the Learn to Program web site<br>
<a rel="nofollow" target="_blank" href="http://www.alan-g.me.uk/">http://www.alan-g.me.uk/</a> <br>
<br>
_______________________________________________<br>
Tutor maillist &nbsp;- &nbsp;<a rel="nofollow" ymailto="mailto:Tutor@python.org" target="_blank" href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a rel="nofollow" target="_blank" href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br>
</div></div></blockquote>
</div></body></html>