Spaces:
Configuration error
Configuration error
Download code/res2md.py from fhyfhy/IMO-solver-new: direct link, hf CLI and curl.
- Browser
- Download file 428 Bytes
-
https://huggingface.co/spaces/fhyfhy/IMO-solver-new/resolve/main/code/res2md.py
- Command line
-
hf download hf://spaces/fhyfhy/IMO-solver-new/code/res2md.py
-
curl -L -o res2md.py https://huggingface.co/spaces/fhyfhy/IMO-solver-new/resolve/main/code/res2md.py
428 Bytes
| import sys | |
| import json | |
| if __name__ == "__main__": | |
| if len(sys.argv) != 2: | |
| print("Usage: python res2md.py <result_file>") | |
| sys.exit(1) | |
| result_file = sys.argv[1] | |
| with open(result_file, "r") as f: | |
| data = f.readlines() | |
| if len(data) == 0: | |
| print("No data found in the file") | |
| sys.exit(1) | |
| data = data[-1].strip() | |
| j = json.loads(data) | |
| print(j) | |