-
Notifications
You must be signed in to change notification settings - Fork 2
/
owo.py
23 lines (17 loc) · 843 Bytes
/
owo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from owoi import run_owo_pseudocode
from owoc import owos_to_code
import argparse
if __name__ == '__main__':
argparser = argparse.ArgumentParser(description='Run OwO code in OwO form.')
argparser.add_argument('file', type=argparse.FileType('r'), help='File with OwO code')
argparser.add_argument('--pseudo', '-p', action='store_true', default=False,
help='Whether to run OwO bytecode or pseudocode. Use this for testing without having to compile')
argparser.add_argument('--debug', '-d', action='store_true', default=False,
help='Debug mode.')
args = argparser.parse_args()
code = args.file.read()
if not args.pseudo:
decompiled_code = owos_to_code(code)
else:
decompiled_code = code
run_owo_pseudocode(decompiled_code, args.debug)