Skip to main content

Python API For Google Translate

 Python Google Translate API

Hello Friends in this blog we will learn about Python API for translation. With the help of this API we can translate any language like google translator.
The name of this API is google-trans-new.

How to install this API:

>>> pip install google_trans_new

Insert this command in your command prompt to install this.


How it works:

  • To know the languages :
                 




It returns the dictionary of the languages.

  • How to translate:


The syntax of translate method is 
translator.translate(text, lang_tgt, lang_src)
Here,

  1. Text = Sentence/text which you want to translate.
  2. lang_tgt = key of that language in which you want to translate your text.
  3. lang_src = The language of your text. It takes auto by default.

Comments

Contact Form

Name

Email *

Message *

Popular posts from this blog

Numpy Library

 Hello Guys, In this blog we will learn about the most important library of python which is NUMPY.  What is numpy? Numpy is a python library that provides a multidimensional array object. It provide fast operations on array. With the help of this library we can do mathematical, logical and basic statistical operation on array.  To use numpy library we have to install it in our machine so that we can use this library. To install this library just insert the following command into your command prompt or terminal.  >>> pip install numpy Now you can easily access the numpy library. How to create 1D Array In the above image, first we import the numpy library. Then with the help of array method we can create the numpy array.  On line no. 2 we create the one dimensional array. In this array you can store integers, float etc. In the array  method we must have to pass list to create a array.  How to create 2D Array           ...