|
1 | 1 | from coderunner import coderunner |
2 | 2 | import pprint |
| 3 | +import os |
| 4 | + |
| 5 | +from dotenv import load_dotenv |
| 6 | +load_dotenv() |
3 | 7 |
|
4 | 8 | source_code = "testfiles/" + "test_python_input.py" |
5 | 9 | language = "Python3" |
6 | 10 | output = "testfiles/output/" + "output2.txt" |
7 | 11 | Input = "testfiles/input/" + "input.txt" |
| 12 | + |
| 13 | + |
| 14 | +API_KEY = os.environ["API_KEY"] |
| 15 | + |
8 | 16 | r = coderunner.code(source_code, language, output, Input) |
| 17 | +r.authenticate(API_KEY) |
9 | 18 |
|
10 | | -r2 = coderunner.code("print(\"yo\")", "Python3", "YO", path=False) |
| 19 | +# r2 = coderunner.code("print(\"yo\")", "Python3", "YO", path=False) |
11 | 20 |
|
12 | | -# run the code |
| 21 | +# # run the code |
13 | 22 | r.run() |
14 | 23 |
|
15 | 24 | print("Run r :") |
16 | 25 | print("Status : " + r.getStatus()) |
17 | 26 |
|
18 | | -r2.run() |
| 27 | +# r2.run() |
19 | 28 |
|
20 | | -print("Run r2 :") |
21 | | -print("Status : " + r2.getStatus()) |
| 29 | +# print("Run r2 :") |
| 30 | +# print("Status : " + r2.getStatus()) |
22 | 31 |
|
23 | | -# check if any error occured |
24 | | -if r.getError() is not None: |
25 | | - pprint.pprint("Error : " + r.getError()) |
26 | | -else: |
27 | | - print("Standard Output : ") |
28 | | - pprint.pprint(r.getOutput()) |
29 | | -print("Execution Time : " + r.getTime()) |
30 | | -print("Memory : " + str(r.getMemory())) |
| 32 | +# # check if any error occured |
| 33 | +# if r.getError() is not None: |
| 34 | +# pprint.pprint("Error : " + r.getError()) |
| 35 | +# else: |
| 36 | +# print("Standard Output : ") |
| 37 | +# pprint.pprint(r.getOutput()) |
| 38 | +# print("Execution Time : " + r.getTime()) |
| 39 | +# print("Memory : " + str(r.getMemory())) |
0 commit comments