Hey thanks a lot to all of you....Now i understood the concept and can use it the right way....<br><br>I have another doubt regarding using radio buttons....<br><br>I am using two radio buttons for user to select either of the two options:<br>
<br>Landscape <br>Portrait<br><br>When i run the program it shows both radio buttons are active <br>I don't know how to toggle between the two radio buttons. <br>Also I want to display the respective image with them Landscape and portrait at the top of each option....Can anyone help me with this?<br>
<br><div class="gmail_quote">On Fri, Apr 9, 2010 at 6:05 AM, Tim Chase <span dir="ltr"><<a href="mailto:python.list@tim.thechases.com">python.list@tim.thechases.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 04/08/2010 12:22 PM, varnikat t wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
it gives me this error<br>
<br>
TypeError: coercing to Unicode: need string or buffer, list found<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the <a href="http://help.it" target="_blank">help.it</a> detects now using glob.glob("*.*.txt")<div class="im"><br>
Can u suggest how to open and read file this way?<br>
<br>
*if glob.glob("*.*.txt"):<br>
file=open(glob.glob("*.*.txt"))<br>
<br>
self.text_view.get_buffer().set_text(file.read())<br>
else:<br>
file=open(glob.glob("*.*.html"))<br>
<br>
self.text_view.get_buffer().set_text(file.read())<br>
</div></blockquote></blockquote>
<br>
glob() returns a list of matching files, not a string. So you need to iterate over those files:<br>
<br>
filenames = glob.glob('*.*.txt')<br>
if filenames:<br>
for filename in filenames:<br>
do_something_text(filename)<br>
else:<br>
for filename in glob('*.*.html'):<br>
do_something_html(filename)<br>
<br>
-tkc<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Varnika Tewari<br>