4.3 KiB
4.3 KiB
foreignthon-xx
French language pack for ForeignThon — write Python in Français.
Install
pip install foreignthon foreignthon-xx
Example
fizzbuzz.xx.py
<!-- ← REPLACE this block with a real .xx.py file in your language -->
pour i dans intervalle(1, 21):
si i % 15 == 0:
afficher("FizzBuzz")
sinonsi i % 3 == 0:
afficher("Fizz")
sinonsi i % 5 == 0:
afficher("Buzz")
sinon:
afficher(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.xx.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 xx.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 Tamil order — condition first, keyword after:
x > 0 @@ஆனால்:
பதிப்பி(x)
Both compile to the same Python. Decompile with postfix output using:
fpy decompile script.py --lang xx --postfix
See Postfix Syntax for full details.
Start a project
fpy new myproject --lang xx
cd myproject
fpy run src/main.xx.py
Documentation
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