Writing Python File at Specific Interval

Shubham Tomar tomarshubham24 at gmail.com
Wed Jul 9 13:17:11 EDT 2014


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, <subhabangalore at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140709/6788885b/attachment.html>


More information about the Python-list mailing list