blob: 94bd234b131ceb1b242c3bb933dfacf6007e10d8 [file] [log] [blame]
Joe Gregorio618e63b2010-11-04 19:55:28 -04001#!/usr/bin/python2.4
2# -*- coding: utf-8 -*-
3#
4# Copyright 2010 Google Inc. All Rights Reserved.
5
6"""Simple command-line example for Translate.
7
8Command-line application that translates
9some text.
10"""
11
12__author__ = 'jcgregorio@google.com (Joe Gregorio)'
13
14from apiclient.discovery import build
15
16import pprint
17
18# Uncomment the next line to get very detailed logging
19# httplib2.debuglevel = 4
20
Joe Gregorioaf276d22010-12-09 14:26:58 -050021
Joe Gregorio618e63b2010-11-04 19:55:28 -040022def main():
23
Joe Gregorio1ae3e742011-02-25 15:17:14 -050024 service = build('translate', 'v2',
Joe Gregorio61d7e962011-02-22 22:52:07 -050025 developerKey='AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0')
Joe Gregorio1ae3e742011-02-25 15:17:14 -050026 print service.translations().list(
Joe Gregorio61d7e962011-02-22 22:52:07 -050027 source='en',
28 target='fr',
29 q=['flower', 'car']
Joe Gregorio618e63b2010-11-04 19:55:28 -040030 ).execute()
31
32if __name__ == '__main__':
33 main()