Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import deepl as mt
- # get api key
- api_key_file = "/home/pico/.omegat/keys/deepl_api_key.txt"
- with open(api_key_file) as f:
- auth_key = f.read().rstrip()
- # get translation
- translator = mt.Translator(auth_key)
- result = translator.translate_text("Hello, world!", target_lang="FR")
- print(result.text) # "Bonjour, le monde !"
Add Comment
Please, Sign In to add comment