<div dir="ltr"><div>Hi Subhabrata,</div><div><br></div>You can use open(name, 'w'), which creates the file if the file does not exist, but it will truncate the existing file. Alternatively, you can use open(name, 'a'); this will create the file if the file does not exist, but will not truncate the existing file.<br>
<div><br></div><div>Ref.: <a href="https://docs.python.org/2/library/functions.html#open">open()</a></div><div><br></div><div>Regards,</div><div>Shubham</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jul 9, 2014 at 8:06 PM, <span dir="ltr"><<a href="mailto:subhabangalore@gmail.com" target="_blank">subhabangalore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Group,<br>
<br>
I am trying to write a file, which would create a new file name<br>
as the code runs.<br>
<br>
The code (a basic crawler) would run every morning<br>
or evening, on a predefined time. [This part is fine].<br>
<br>
In the next part, I am trying to store the daily<br>
results to a new file.<br>
<br>
As I researched I found some tips around time module,<br>
logging module, pythoncom etc. But not getting any important<br>
lead.<br>
<br>
If any one of the esteemed members may kindly suggest.<br>
<br>
Regards,<br>
Subhabrata Banerjee.<br>
<span class="HOEnZb"><font color="#888888">--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div>