program to generate data helpful in finding duplicate large files

Ian Kelly ian.g.kelly at gmail.com
Fri Sep 19 19:20:14 CEST 2014


On Fri, Sep 19, 2014 at 12:45 AM, Chris Angelico <rosuav at gmail.com> wrote:
> On Fri, Sep 19, 2014 at 3:45 PM, Steven D'Aprano
>>     s = '\0'.join([thishost, md5sum, dev, ino, nlink, size, file_path])
>>     print s
>
> That won't work on its own; several of the values are integers. So
> either they need to be str()'d or something in the output system needs
> to know to convert them to strings. I'm inclined to the latter option,
> which simply means importing print_function from __future__ and
> setting sep=chr(0).

Personally, I lean toward converting them with map in this case:

    s = '\0'.join(map(str, [thishost, md5sum, dev, ino, nlink, size,
file_path]))



More information about the Python-list mailing list