Created
July 19, 2018 22:27
-
-
Save andyczerwonka/9a7048fafc9be38f8050c9ed8f11051e to your computer and use it in GitHub Desktop.
Errors with the submit process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
def solve_it(input_data): | |
cmd = "java -jar ./anyint-scala/target/scala-2.12/anyint.jar " + input_data | |
p = subprocess.Popen( | |
cmd, | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE, | |
shell=True) | |
(out, err) = p.communicate() | |
if 0 == p.wait(): | |
return out | |
else: | |
return err | |
if __name__ == '__main__': | |
print('This script submits the integer: %s\n' % solve_it('123')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@adamw I made the invalid assumption that the input data was supposed to be the input to my answer... it is not...
They use that input data as a general input for all the assignments, and in this case, it's moot. I'm supposed to ignore it, which is why they send an empty string in the example.
Thanks for sharing.