From d051b56cd2ff081c2f439e2e29f988cfb09853ec Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Wed, 31 Mar 2021 11:57:21 -0400 Subject: [PATCH] Fixed up argument count, added some comments --- mspconvert.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mspconvert.py b/mspconvert.py index 7a5b13d..9b68cc3 100755 --- a/mspconvert.py +++ b/mspconvert.py @@ -8,19 +8,24 @@ import sys print("MS Paint file converter utility v0.1") -print("Written by A.M. Rowsell, MPL Version 2.0 license\n\n") -if len(sys.argv) < 1: +print("Written by A.M. Rowsell, MPL Version 2.0 license\n") +if len(sys.argv) < 2: print("Please provide filename (without extension)!") + print("Example usage:\n./mspconvert.py DONUT") + sys.exit(255) filename = sys.argv[1] width = 0 height = 0 +# The output file follows the very simple XBM format +# which is just a basic C syntax array variable outputString = ''' #define {0}_width {1} #define {0}_height {2} static unsigned char {0}_bits [] = ''' +# Output data starts as an empty bytearray outputData = b'' try: