seek operation in python
Cecil at decebal.nl
Thu Apr 30 22:50:44 CEST 2015
Op Thursday 30 Apr 2015 21:38 CEST schreef Larry Hudson:
> On 04/30/2015 01:06 AM, Cecil Westerhof wrote:
>> I wrote a module where I have:
>> def get_indexed_message(message_filename, index):
>> Get index message from a file, where 0 gets the first message
>> return open(expanduser(message_filename),
> Very minor nit unrelated to the file closing question:
> This would be a good place to give index a default value...
> def get_indexed_message(message_filename, index=0):
Why would you want this? I think the index should always be defined.
Senior Software Engineer
More information about the Python-list