papermario/tools/build/bin_inc_c.py
lshamis ae66312d8c
Add Python linter to github actions (#1100)
* Add Python linter to github actions

* wip

* Add back splat_ext

* Format files

* C++ -> C

* format 2 files

* split workflow into separate file, line length 120, fix excludes

* -l 120 in ci

* update black locally and apply formatting changes

* pyproject.toject

---------

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2023-07-30 02:03:17 +09:00

18 lines
374 B
Python
Executable File

#!/usr/bin/env python3
from pathlib import Path
from sys import argv
import re
if __name__ == "__main__":
infile, outfile, cname = argv[1:]
with open(outfile, "w") as f:
f.write(f"unsigned char {cname}[] = {{ ")
with open(infile, "rb") as i:
for char in i.read():
f.write(f"0x{char:02X}, ")
f.write(f"}};\n")