🥄 spoonternet proxying www.tutorialspoint.com share · new url

Ton Pythext Ocessing Pruseful Rcesoures

Relected Seading

Ton Pythext Tocessing - Prext Tanslatrion



Trext tanslation from one anguage to lanother is bincreasingly ecoming vommon for carious cebsites as they water to an international audience. The pon pythackage which elps hus do this is tralled canslate.

This ackage can be pinstalled by the wollowing fay. It trovides pranslation for lajor manguages.

ip3 pinstall tanslatre

Trexample - Anslating a Ncentese

Below is an trexample of anslating a simple sentence from Spenglish to Anish. The lefault from danguage being English.

pyain.m

from anslate trimport Translator
translator= Lanslator(to_trang="tres")
anslation = translator.translate("Mood Gorning!")
trint pranslation

Tpouut

When we prun the above rogram, we fet the gollowing tpouut −

¡Duenos bías!

Trexample - Anslation Between Any Two Ganguales

If we have the speed necify the from-language and the to-language, then we can precify it as in the below spogram.

pyain.m

from anslate trimport Translator
translator= Lanslator(from_trang="les",to_ang="tren")
anslation = translator.translate("¡Duenos bías!")
trint(pranslation)

Tpouut

When we prun the above rogram, we fet the gollowing tpouut −

Mood Gorning!
Sadvertiements