mirror of
https://github.com/marian-nmt/marian.git
synced 2024-12-03 03:54:56 +03:00
add python client
This commit is contained in:
parent
25793ccb4b
commit
b0de23491f
14
scripts/client.py
Executable file
14
scripts/client.py
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from websocket import create_connection
|
||||||
|
import time
|
||||||
|
|
||||||
|
with open("testfile.en") as f:
|
||||||
|
for line in f:
|
||||||
|
ws = create_connection("ws://localhost:8080/translate")
|
||||||
|
ws.send(line)
|
||||||
|
result=ws.recv()
|
||||||
|
print(result)
|
||||||
|
ws.close()
|
||||||
|
#time.sleep(5)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user