<br><br><div><span class="gmail_quote">On 10/12/06, <b class="gmail_sendername">Asrarahmed Kadri</b> &lt;<a href="mailto:ajkadri@googlemail.com">ajkadri@googlemail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br clear="all">Hello,</div>
<div>&nbsp;</div>
<div>Sorry, but this is a very basic questions...</div>
<div>Can you tell me how to check the existence of a file..</div></blockquote><div><br>
&nbsp;&nbsp;&nbsp; to check if a file exists, you can use os.path.exists(path) <br>
&nbsp;&nbsp;&nbsp; or look at <a href="http://python.org/doc/current/lib/module-os.path.html">http://python.org/doc/current/lib/module-os.path.html</a> for more info<br>
&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Also if a file exists, and we open it in a write mode, it would be truncated to zero length. So what is the way out of this??#
</div>
<div>&nbsp;</div>
<div>Regards,</div>
<div>&nbsp;</div>
<div>Asrar<br>-- <br>To HIM you shall return. </div>

<br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tutor@python.org">Tutor@python.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">
http://mail.python.org/mailman/listinfo/tutor</a><br><br><br></blockquote></div><br>