Skip to content

Instantly share code, notes, and snippets.

View meyer9's full-sized avatar
🏠
Working from home

Julian Meyer meyer9

🏠
Working from home
View GitHub Profile
@meyer9
meyer9 / converttoppm.py
Last active August 9, 2017 20:22 — forked from anonymous/converttoppm.py
Modifications to Scheme art to run faster
import struct
with open('test.ppm', 'wb') as ppm_file:
ppm_file.write("P6\n".encode('ascii'))
with open('test.txt', 'r') as out:
width = int(out.readline())
height = int(out.readline())
ppm_file.write((str(width) + ' ' + str(height) + '\n').encode('ascii'))
ppm_file.write('255\n'.encode('ascii'))