Writing Python Programs in Other Languages

GTCC

Globalization

 
Rotating earth animated transparent

 

Example:

It is a typical problem for beginning Computer Programming students to be able to print "Hello World" as the first assignment. Below is an example of printing "Hello World" to the display using the Python programming language, and the French spoken language.

 

Prompt

French:

J'habite au Canada et je parle français mais pas anglais. Je souhaite programmer en Python tout de suite sans apprendre l'anglais au préalable. Existe-t-il une version de Python qui fonctionne en français?

 

English:

(I live in Canada and I speak French but not English. I wish to program in Python right away without learning English first. Is there a version of Python that works in French?)

 

Reply 1:

French:

C'est une bonne question! Bien que la plupart des ressources et de la documentation pour Python soient en anglais, Python lui-même prend en charge plusieurs langues, dont le français. Vous pouvez définir la langue de l'interpréteur Python en utilisant l'option -X suivie du module __future__. Par exemple, pour utiliser Python en français, vous pouvez exécuter:

 

English:

(It's a good question! Although most resources and documentation for Python are in English, Python itself supports multiple languages, including French. You can set the Python interpreter language using the -X option followed by the __future__ module. For example, to use Python in French, you can run:)

 

Code to Make it Happen from the Command Line:

python -Xutf8 -c "from __future__ import barry_as_FLUFL; print('Salut le monde!')"

 

(python -Xutf8 -c "from __future__ import barry_as_FLUFL; print('Salut le monde!')"  the output is French for "Hello World!)

 

Explanation:

French:

Cela dit, il peut être utile de comprendre quelques termes en anglais, car la plupart des ressources en ligne et de la documentation sont disponibles dans cette langue. Mais n'hésitez pas à programmer en Python en français et à poser des questions si nécessaire!

 

English:

(That said, it can be helpful to understand some English terms, as most online resources and documentation are available in that language. But don't hesitate to program in Python in French and ask questions if necessary!)

 

 

 

 

References:

From Wikipedia, the free encyclopedia

https://en.wikipedia.org/wiki/

https://commons.wikimedia.org/wiki/File:Rotating_earth_animated_transparent.gif