Created
October 23, 2019 19:58
-
-
Save jtmcx/4cc75ed417d3aa192d9cae1c78824502 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import argparse | |
def parse_args(): | |
parser = argparse.ArgumentParser(description="Unprocess some stuff.") | |
parser.add_argument("input", type=str, help="input csv file") | |
parser.add_argument("output", type=str, help="output blk file") | |
return parser.parse_args() | |
def main(): | |
args = parse_args() | |
with open(args.input, "r") as f: | |
data = f.read() | |
data = data.strip().replace("\n", ",") | |
data = data.split(",") | |
data = [int(x) for x in data] | |
with open(args.output, "wb") as f: | |
for b in data: | |
f.write(chr(b).encode("charmap")) | |
# f.write(bytearray(data)) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment