def msg(m):
sys.stderr.write(m)
-def sendfile(src, dst):
- cnt = 0
- while 1:
- s = src.read(10000)
- if s == "" or s == b"": break
- cnt += len(s)
- dst.write(s)
- return cnt
-
def append_to(log, msg):
f = open(log, "a")
f.write("%s\n" % msg)
return s
else:
raise TypeError("Expected bytes or string, but got %s." % type(s))
+
+def cmp(a, b):
+ return (a > b) - (a < b)