samedi 30 juillet 2016

How to translate entire .txt file using Google Translate API in Python?

I am trying to translate an entire .txt file using Google Translate API in Python.

The default code is:

print(service.translations().list(source='zh',
                                  target='en',
                                  q=['上海熙缘节能环保科技服务有限公司',
                                     '广东宏德科技物业有限公司']).execute())

if __name__ == '__main__':
    main()

How can I modify this code so it can translate a .txt file?

Aucun commentaire:

Enregistrer un commentaire