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

View File

@ -21,6 +21,7 @@ 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.split():
for x in to_run.split:
x_split = x.split("\n")
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])