|
3 | 3 |
|
4 | 4 | print("Subexample 1") |
5 | 5 | result = judge0.run(source_code="print('hello, world')") |
6 | | -fs = Filesystem(result.post_execution_filesystem) |
| 6 | +fs = Filesystem(content=result.post_execution_filesystem) |
7 | 7 | for f in fs: |
8 | 8 | print(f.name) |
9 | 9 | print(f) |
10 | 10 | print() |
11 | 11 |
|
12 | 12 |
|
13 | 13 | print("Subexample 2") |
14 | | -fs = Filesystem(File("my_file.txt", "hello, world")) |
| 14 | +fs = Filesystem(content=File(name="my_file.txt", content="hello, world")) |
15 | 15 | result = judge0.run( |
16 | 16 | source_code="print(open('my_file.txt').read())", additional_files=fs |
17 | 17 | ) |
18 | 18 | print(result.stdout) |
19 | | -for f in Filesystem(result.post_execution_filesystem): |
| 19 | +for f in Filesystem(content=result.post_execution_filesystem): |
20 | 20 | print(f.name) |
21 | 21 | print(f) |
22 | 22 | print() |
23 | 23 |
|
24 | 24 |
|
25 | 25 | print("Subexample 3") |
26 | | -fs = Filesystem(File("my_file.txt", "hello, world")) |
| 26 | +fs = Filesystem(content=File(name="my_file.txt", content="hello, world")) |
27 | 27 | result = judge0.run( |
28 | 28 | source_code="print(open('my_file.txt').read())", additional_files=fs |
29 | 29 | ) |
|
35 | 35 |
|
36 | 36 | print("Subexample 4") |
37 | 37 | fs = Filesystem( |
38 | | - [ |
39 | | - File("my_file.txt", "hello, world"), |
40 | | - File("./dir1/dir2/dir3/my_file2.txt", "hello, world2"), |
| 38 | + content=[ |
| 39 | + File(name="my_file.txt", content="hello, world"), |
| 40 | + File(name="./dir1/dir2/dir3/my_file2.txt", content="hello, world2"), |
41 | 41 | ] |
42 | 42 | ) |
43 | 43 | result = judge0.run(source_code="find .", additional_files=fs, language=46) |
44 | 44 | print(result.stdout) |
45 | | -for f in Filesystem(result.post_execution_filesystem): |
| 45 | +for f in Filesystem(content=result.post_execution_filesystem): |
46 | 46 | print(f.name) |
47 | 47 | print(f) |
48 | 48 | print() |
0 commit comments