b***y 发帖数: 2799 | 1 ☆─────────────────────────────────────☆
goodbug (好虫) 于 (Fri Jul 11 11:44:11 2008) 提到:
It's interesting to see Python people's philosophy.
For the same problem, Python wrote it this way (wormcc gave
a 2 liners but this one is cleaner for comparison purpose)
f = [open('f'+str(i)+'.bin', 'w') for i in xrange(1,6)]
x = open('abc.bin').read()
for i in xrange(len(x)): f[i%5].write(x[i])
And Java will do it this way:
DataInputStream input = null;
DataOutputStream[] output = new Dat |
|