Translator-GO-Endpoint/translator/translate.py

15 lines
335 B
Python
Raw Permalink Normal View History

2024-03-14 21:17:46 +00:00
import argostranslate.package
import argostranslate.translate
import sys
def translate():
message = sys.argv[1]
from_lang = sys.argv[2]
to_lang = sys.argv[3]
translation = argostranslate.translate.translate(message, from_lang, to_lang)
print(translation)
if __name__ == "__main__":
translate()