Hi Subhabrata,

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.

Ref.: open() <https://docs.python.org/2/library/functions.html#open>

Regards,
Shubham


On Wed, Jul 9, 2014 at 8:06 PM, <subhabangal...@gmail.com> wrote:

> Dear Group,
>
> I am trying to write a file, which would create a new file name
> as the code runs.
>
> The code (a basic crawler) would run every morning
> or evening, on a predefined time. [This part is fine].
>
> In the next part, I am trying to store the daily
> results to a new file.
>
> As I researched I found some tips around time module,
> logging module, pythoncom etc. But not getting any important
> lead.
>
> If any one of the esteemed members may kindly suggest.
>
> Regards,
> Subhabrata Banerjee.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to