Skip to content

Instantly share code, notes, and snippets.

@vovuh vovuh/runner.py Secret
Created Dec 8, 2018

Embed
What would you like to do?
exepath = r"C:\Users\Vladimir\Documents\Work\FHC2018R1\D\evening.exe" # path to the exe-file
path = "\\".join(exepath.split("\\")[:-1:]) # directory with tests (by default they should be in the directory with exe-file)
testCount = 1 # the number of tests
# tests are in the format (input: xxx output: xxx.a)
import subprocess
for i in range(testCount):
name = i + 1
fin = open(str(path + '\\' + "%03d" % name), 'r')
fout = open(str(path + '\\' + "%03d" % name) + '.a', 'w')
p = subprocess.Popen(path, stdin=fin, stdout=fout)
p.communicate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.