Skip to content

Instantly share code, notes, and snippets.

@andyczerwonka
Created July 19, 2018 22:27
Show Gist options
  • Save andyczerwonka/9a7048fafc9be38f8050c9ed8f11051e to your computer and use it in GitHub Desktop.
Save andyczerwonka/9a7048fafc9be38f8050c9ed8f11051e to your computer and use it in GitHub Desktop.
Errors with the submit process
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'))
@andyczerwonka
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment