Skip to content

Commit

Permalink
Add python template
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoVictor committed Mar 16, 2024
1 parent 077a66e commit a07c542
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions container/templates/python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import json
import sys

# @code-here

def executor(input):
response = {
'input': input,
}

try:
output = run(input)

response['output'] = output
except Exception as err:
response['output'] = err;

return response

result = []
inputs = json.loads(sys.argv[1])

for input in inputs:
result.append(executor(input))

output_json = json.dumps(result)
print(output_json)

sys.stdout.flush()

0 comments on commit a07c542

Please sign in to comment.