John Machin wrote:
> Then before you rush and implement something, google around and look in
> the Tools and Scripts directories in the Python distribution; I'm quite
> sure I've seen something like a "duplicate file detector" written in
> Python somewhere.
first google hit:
http://sebsauvag
vegetax wrote:
> How can i make my custom class an element of a set?
>
> the idea is that it accepts file paths and construct a set of unique
> files (the command "cmp" compares files byte by byte.),the files can
> have different paths but the same content
>
Q: How do I transport ten sumo wrestle
vegetax wrote:
> Steven Bethard wrote:
>
> > vegetax wrote:
> >> How can i make my custom class an element of a set?
> >>
> >> class Cfile:
> >> def __init__(s,path): s.path = path
> >>
> >> def __eq__(s,other):
> >>print 'inside equals'
> >>return not os.popen('cmp %s %s' % (s.path,oth
vegetax wrote:
How can i make my custom class an element of a set?
class Cfile:
def __init__(s,path): s.path = path
def __eq__(s,other):
print 'inside equals'
return not os.popen('cmp %s %s' % (s.path,other.path)).read()
def __hashcode__(s): return s.path.__hashcode__()
the idea is that
Steven Bethard wrote:
> vegetax wrote:
>> How can i make my custom class an element of a set?
>>
>> class Cfile:
>> def __init__(s,path): s.path = path
>>
>> def __eq__(s,other):
>>print 'inside equals'
>>return not os.popen('cmp %s %s' % (s.path,other.path)).read()
>>
>> def __ha
vegetax wrote:
How can i make my custom class an element of a set?
class Cfile:
def __init__(s,path): s.path = path
def __eq__(s,other):
print 'inside equals'
return not os.popen('cmp %s %s' % (s.path,other.path)).read()
def __hashcode__(s): return s.path.__hashcode__()
the idea is that
Delaney, Timothy C (Timothy) wrote:
> vegetax wrote:
>
>> def __hashcode__(s): return s.path.__hashcode__()
>
> Try __hash__ ...
>
> Tim Delaney
sorry about the typo, it is indead __hash__() that i tried
--
http://mail.python.org/mailman/listinfo/python-list
vegetax wrote:
> def __hashcode__(s): return s.path.__hashcode__()
Try __hash__ ...
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list