fork download
  1. import urllib.request
  2. import json
  3. def yatrl(word):
  4. link_one = 'https://t...content-available-to-author-only...x.net/api/v1.5/tr.json/translate?key='
  5. link_two = 'trnsl.1.1.20150103T143421Z.56fe13b7247ddb54.19bc22fe11e70a50d34cf3a3450c7287d64aa3e5&text='
  6. link_three = '&lang=en-ru&[format=plain]'
  7. return ''.join([i+', ' for i in json.loads(urllib.request.urlopen(link_one+link_two+word+link_three).read().decode()).get('text')]).strip(', ')
  8. while True:
  9. my_word = input('Введите ваше слово здесь: ')
  10. print(yatrl(my_word))
Runtime error #stdin #stdout #stderr 0.23s 15240KB
stdin
Standard input is empty
stdout
Введите ваше слово здесь: 
stderr
Traceback (most recent call last):
  File "./prog.py", line 9, in <module>
EOFError: EOF when reading a line