On Thu, Mar 5, 2015 at 7:20 PM, Amit Kucheria <amit.kuche...@linaro.org> wrote:
> On Thu, Mar 5, 2015 at 3:49 PM, Vincent Guittot
> <vincent.guit...@linaro.org> wrote:
>> On 19 November 2014 at 14:14, pi-cheng.chen <pi-cheng.c...@linaro.org> wrote:
>>> +
>>> +if __name__ == '__main__':
>>> +    tmp = 'tmp.json'
>>
>> your tmp file should be a bit more unique than tmp.json. I can imagine
>> that the user of tune_json.py already has a tmp.json in the dir which
>> will be overwritten by the script.
>> You could add something like the current time stamp in the temporary
>> file name to reduce the probability to overwrite a user's file
>
> Or actually use the python standard library functions to generate
> unique temporary files:
> https://docs.python.org/2/library/tempfile.html
>
> If you care about referencing the file externally, NamedTemporaryFile
> might be the right method to use.

Hi Vincent & Amit,

Thanks for reviewing.
I will fix the temporary file naming.

Best Regards,
Pi-Cheng

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to