Skip to content

Commit fa3c86f

Browse files
Add Custom Judge0 Client example
1 parent 3e4d088 commit fa3c86f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,25 @@ result = judge0.run(submissions=submission)
349349
print(result.stdout)
350350
print(result.post_execution_filesystem.find("./my_dir2/my_file2.txt"))
351351
```
352+
353+
### Custom Judge0 Client
354+
355+
This example shows how to use Judge0 Python SDK with your own Judge0 instance.
356+
357+
```python
358+
import judge0
359+
360+
client = judge0.Client(endpoint="http://127.0.0.1:2358", auth_headers=None)
361+
362+
source_code = """
363+
#include <stdio.h>
364+
365+
int main() {
366+
printf("hello, world\\n");
367+
return 0;
368+
}
369+
"""
370+
371+
result = judge0.run(client=client, source_code=source_code, language=judge0.C)
372+
print(result.stdout)
373+
```

0 commit comments

Comments
 (0)