57 lines
1.1 KiB
Markdown
57 lines
1.1 KiB
Markdown
# ForeignThon
|
|
|
|
Write Python in any human language.
|
|
|
|
ForeignThon transpiles `.es.py`, `.ta.py` and more into standard Python — keywords, builtins, exceptions, all translated. Errors come back in your language too.
|
|
|
|
```python
|
|
# main.es.py
|
|
def saludar(nombre):
|
|
retornar f"Hola, {nombre}!"
|
|
|
|
para i en dist(3):
|
|
escribir(saludar(f"mundo {i}"))
|
|
```
|
|
|
|
```bash
|
|
fpy run main.es.py
|
|
# Hola, mundo 0!
|
|
# Hola, mundo 1!
|
|
# Hola, mundo 2!
|
|
```
|
|
|
|
## Install
|
|
|
|
```bash
|
|
pip install foreignthon # Core
|
|
pip install foreignthon-es # Spanish
|
|
pip install foreignthon-ta # Tamil
|
|
```
|
|
|
|
## Quick start
|
|
|
|
```bash
|
|
fpy new myproject --lang es
|
|
cd myproject
|
|
fpy run src/main.es.py
|
|
```
|
|
|
|
## Commands
|
|
|
|
| Command | Description |
|
|
|---|---|
|
|
| `fpy new <name> --lang <code>` | Scaffold a new project |
|
|
| `fpy run <file>` | Transpile and run |
|
|
| `fpy compile <file>` | Transpile to `.compiled.py` |
|
|
| `fpy decompile <file> --lang <code>` | Convert Python back to a language |
|
|
| `fpy check <file>` | Validate without running |
|
|
|
|
## Documentation
|
|
|
|
→ [fpy.keshavanand.net](https://foreignthon.keshavanand.net)
|
|
|
|
## License
|
|
|
|
GPL v3
|
|
|