with open('starry_night.txt', 'w') as f: s = ['# width height', '{0} {1}'.format(im.size[0], im.size[1]), '# block size', '4', '# initial color', '0 0 0', '# row column red green blue'] f.write(os.linesep.join(s) + os.linesep) for ((row, col), colors) in itertools.izip(itertools.product(xrange(im.size[1]), xrange(im.size[0])), imdata): things = [str(x) for x in (row, col) + colors] f.write(' '.join(things + ['\n']))
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4