Skip to content

Instantly share code, notes, and snippets.

@vovuh

vovuh/runner.py Secret

Last active August 29, 2020 03:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vovuh/8cca31876a710ccba1b56b5127d66b32 to your computer and use it in GitHub Desktop.
Save vovuh/8cca31876a710ccba1b56b5127d66b32 to your computer and use it in GitHub Desktop.
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(exepath, stdin=fin, stdout=fout)
p.communicate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment