Remove locale, fix bug

multiline-output
drunkendog 2023-09-12 13:58:13 +01:00
parent 3bbfab219f
commit 60a321e51b
1 changed files with 2 additions and 2 deletions

View File

@ -21,6 +21,6 @@ for file_name in glob.glob("*.c", recursive=False):
subprocess.run(["gcc", "-std=c11", "-Wall", "-g", file_name], check=True)
with open(next(x for x in file_list if file_name.rstrip(".c") in x)) as f:
to_run = f.read().split("\n\n")
for x in to_run:
return_data = subprocess.run(["./a.out"], input=x[0].rstrip().encode('utf-8'), capture_output=True).stdout.decode()
for x in to_run.split():
return_data = subprocess.run(["./a.out"], input=x[0].rstrip().encode(), capture_output=True).stdout.decode()
print(f"\u001b[{31 + int(return_data.rstrip() == x[1].rstrip())}m{return_data}\u001b[0m", x[1])