Hello Guys,
I'm looking to write a Log file which will be CSV based, and there is a good possibility that it'll get quite busy once its up and running, so I'm looking for the most efficient way to achieve it. Whilst I'm sure i could do something like this. myfile = open("Logs/Application.txt", "w") myfile.write('col1, col2, col3, col4, col5') myfile.close But I'm a little apprehensive that open() and close() on a very regular basis is just going to cause issues. I'm also a little worried that we'll end up with 'race' type conditions and things going missing. So my next thought was to just have an open object for the file, and then perform multiple rights, until I need to send the report file somewhere else, at which point I would close it. This in itself causes more issues as we're running in a buffer which is just going to eat my memory, and as this is on an embedded system which may lose power, we'd be kissing good bye to all the logs until that point. What would you guys suggest to be the most efficient way to handle this? Thanks, Rob
-- http://mail.python.org/mailman/listinfo/python-list