Fixed up argument count, added some comments
This commit is contained in:
parent
4758f40d7e
commit
d051b56cd2
1 changed files with 7 additions and 2 deletions
|
@ -8,19 +8,24 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
print("MS Paint file converter utility v0.1")
|
print("MS Paint file converter utility v0.1")
|
||||||
print("Written by A.M. Rowsell, MPL Version 2.0 license\n\n")
|
print("Written by A.M. Rowsell, MPL Version 2.0 license\n")
|
||||||
if len(sys.argv) < 1:
|
if len(sys.argv) < 2:
|
||||||
print("Please provide filename (without extension)!")
|
print("Please provide filename (without extension)!")
|
||||||
|
print("Example usage:\n./mspconvert.py DONUT")
|
||||||
|
sys.exit(255)
|
||||||
|
|
||||||
filename = sys.argv[1]
|
filename = sys.argv[1]
|
||||||
width = 0
|
width = 0
|
||||||
height = 0
|
height = 0
|
||||||
|
# The output file follows the very simple XBM format
|
||||||
|
# which is just a basic C syntax array variable
|
||||||
outputString = '''
|
outputString = '''
|
||||||
#define {0}_width {1}
|
#define {0}_width {1}
|
||||||
#define {0}_height {2}
|
#define {0}_height {2}
|
||||||
static unsigned char {0}_bits [] =
|
static unsigned char {0}_bits [] =
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
# Output data starts as an empty bytearray
|
||||||
outputData = b''
|
outputData = b''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue