From f48dd00bc3c94c6515c6cd0c1fb24eb0d84a9371 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Tue, 28 Dec 2021 23:45:28 +0100 Subject: [PATCH] things --- wpotd.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wpotd.py b/wpotd.py index 24133fe..2b0a97d 100644 --- a/wpotd.py +++ b/wpotd.py @@ -1,4 +1,12 @@ #!/usr/bin/env python3 -print('Content-Type: image/png') -print(open('out/waves.png', 'rb').read()) +import sys +import io +sys.path.append('..') +from waves import create_wpotd + +buf = io.BytesIO() +create_wpotd(buf) +sys.stdout.write('Content-Type: image/png\r\n\r\n') +sys.stdout.flush() +sys.stdout.buffer.write(buf.getvalue())