Encode string before passing it to sp.run
parent
65980d0191
commit
15dd2d1618
|
@ -22,5 +22,5 @@ for file_name in glob.glob("*.c", recursive=False):
|
||||||
with open(next(x for x in file_list if file_name.rstrip(".c") in x)) as f:
|
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")
|
to_run = f.read().split("\n\n")
|
||||||
for x in to_run:
|
for x in to_run:
|
||||||
return_data = subprocess.run(["./a.out"], input=x[0].rstrip(), capture_output=True).stdout
|
return_data = subprocess.run(["./a.out"], input=x[0].rstrip().encode('utf-8'), capture_output=True).stdout
|
||||||
print(f"\u001b[{31 + int(return_data.rstrip() == x[1].rstrip())}m{return_data}\u001b[0m")
|
print(f"\u001b[{31 + int(return_data.rstrip() == x[1].rstrip())}m{return_data}\u001b[0m")
|
||||||
|
|
Loading…
Reference in New Issue