20 lines
383 B
Python
Executable file
20 lines
383 B
Python
Executable file
#!/usr/bin/env python3
|
|
#
|
|
# Requirements: nrepl-python-client
|
|
#
|
|
|
|
import sys
|
|
import nrepl
|
|
|
|
code = sys.stdin.read().strip()
|
|
print(code)
|
|
c = nrepl.connect("nrepl://localhost:1667")
|
|
c.write({"op": "eval", "code": code})
|
|
response = c.read()
|
|
try:
|
|
print(";; " + response['value'])
|
|
except KeyError:
|
|
try:
|
|
print(";; ERROR: " + response['err'])
|
|
except KeyError:
|
|
pass
|