Skip to content

foreignthon-te

Telugu language pack for ForeignThon — write Python in తెలుగు.


Install

pip install foreignthon foreignthon-te

Example

fizzbuzz.te.py

ప్రతి i లోపల పరిధి(1, 21):
    ఒకవేళ i % 15 == 0:
        చూపు("FizzBuzz")
    లేకపోతే_ఒకవేళ i % 3 == 0:
        చూపు("Fizz")
    లేకపోతే_ఒకవేళ i % 5 == 0:
        చూపు("Buzz")
    లేనిపక్షంలో:
        చూపు(i)

Compiles to standard Python:

for i in range(1, 21):
    if i % 15 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)

Run it directly without compiling first:

fpy run fizzbuzz.te.py

Keyword reference

Python తెలుగు
if ఒకవేళ
else లేనిపక్షంలో
elif లేకపోతే_ఒకవేళ
for ప్రతి
while ఎంతవరకు
def రూపొందించు
class మాదిరి
return ఇవ్వు
import చేర్చు
True అవును
False కాదు_విలువ
None శూన్యం
print చూపు
input అడుగు
len పొడవు
range పరిధి

The full mapping is in te.json.


Postfix syntax

This pack supports the @@ postfix operator for natural SOV word order. Instead of writing the keyword first:

ఒకవేళ x > 0:
    చూపు(x)

You can write it in natural Telugu order — condition first, keyword after:

x > 0 @@ఒకవేళ:
    చూపు(x)

Both compile to the same Python. Decompile with postfix output using:

fpy decompile script.py --lang te --postfix

See Postfix Syntax for full details.


Start a project

fpy new myproject --lang te
cd myproject
fpy run src/main.te.py

Documentation

foreignthon.keshavanand.net


Contributing

Found a missing translation or a better keyword for your language? Open an issue or PR — no access to the core repo is needed.


License

GPL v3