Spaces:
Sleeping
Sleeping
File size: 9,201 Bytes
0807ad2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | # Spanish (Espa帽ol) - Python Quick Reference



> Write Python code in Spanish. This guide shows the Spanish keywords
> to use for Legesher to understand your code.
## Language Details
| Attribute | Value |
| --------- | ----- |
| **Language** | Spanish |
| **Native Name** | Espa帽ol |
| **Script** | Latin |
| **ISO 639-1** | `es` |
| **ISO 639-2** | `spa` |
| **BCP 47 Tag** | `es` |
| **Text Direction** | Left-to-Right (LTR) |
| **Status** | Experimental |
## Keywords (39 terms)
These are Python's reserved words translated to Spanish.
| English | Spanish |
| ------- | ------ |
| `and` | `y` |
| `as` | `como` |
| `assert` | `afirmar` |
| `async` | `asincr贸nico` |
| `await` | `esperar` |
| `break` | `romper` |
| `case` | `caso` |
| `class` | `clase` |
| `continue` | `continuar` |
| `def` | `definir` |
| `del` | `eliminar` |
| `elif` | `si_no` |
| `else` | `sino` |
| `except` | `excepto` |
| `except*` | `excepto*` |
| `False` | `falso` |
| `finally` | `finalmente` |
| `for` | `por` |
| `from` | `desde` |
| `global` | `declara_variable_global` |
| `if` | `si` |
| `import` | `importar` |
| `in` | `en` |
| `is` | `ser` |
| `lambda` | `funcion_anonima` |
| `match` | `coincidir` |
| `None` | `nulo` |
| `nonlocal` | `nolocal` |
| `not` | `no` |
| `or` | `o` |
| `pass` | `pasar` |
| `raise` | `levantar` |
| `return` | `devolver` |
| `True` | `verdadero` |
| `try` | `probar` |
| `type` | `tipo` |
| `while` | `mientras` |
| `with` | `con` |
| `yield` | `dar` |
## Built-in Functions (72 terms)
Python's built-in functions and types in Spanish.
| English | Spanish |
| ------- | ------ |
| `abs` | `valorabsoluto` |
| `aiter` | `iterador_asincr贸nico` |
| `all` | `todo` |
| `anext` | `pr贸ximo` |
| `any` | `cualquier` |
| `ascii` | `asciiificar` |
| `bin` | `binario` |
| `bool` | `booleano` |
| `breakpoint` | `puntodeinterrupci贸n` |
| `bytearray` | `conjuntoDeBytes` |
| `bytes` | `bytes_inmutables` |
| `callable` | `llamable` |
| `chr` | `car谩cter` |
| `classmethod` | `m茅tododeclase` |
| `compile` | `compilar` |
| `complex` | `complejo` |
| `delattr` | `eliminar_atributo` |
| `dict` | `diccionario` |
| `dir` | `directorio` |
| `divmod` | `division_con_resta` |
| `ellipsis` | `elipsis` |
| `enumerate` | `elenumerar` |
| `eval` | `eval煤o` |
| `exec` | `ejecutar` |
| `filter` | `filtrar` |
| `float` | `flotante` |
| `format` | `formatear` |
| `frozenset` | `conjuntocongelado` |
| `getattr` | `obtenerelatributo` |
| `globals` | `globales` |
| `hasattr` | `teneratributo` |
| `hash` | `resumen_hash` |
| `help` | `ayuda` |
| `hex` | `hexadecimal` |
| `id` | `identificador` |
| `input` | `entrada` |
| `int` | `entero` |
| `isinstance` | `ser_de_la_clase` |
| `issubclass` | `subclasede` |
| `iter` | `iterar` |
| `len` | `longitud` |
| `list` | `lista` |
| `locals` | `loslocales` |
| `map` | `mapear` |
| `max` | `m谩ximo` |
| `memoryview` | `vistadememoria` |
| `min` | `minimo` |
| `next` | `siguiente` |
| `notimplemented` | `noimplementado` |
| `object` | `objeto` |
| `oct` | `octal` |
| `open` | `abrir` |
| `ord` | `ordinal` |
| `pow` | `potencia` |
| `print` | `imprimir` |
| `property` | `propiedad` |
| `range` | `rango` |
| `repr` | `representaci贸n` |
| `reversed` | `revesado` |
| `round` | `redondear` |
| `set` | `conjunto` |
| `setattr` | `asignar` |
| `slice` | `rebanada` |
| `sorted` | `ordenado` |
| `staticmethod` | `est谩tico` |
| `str` | `cadena` |
| `sum` | `sumar` |
| `super` | `superClase` |
| `tuple` | `tupla` |
| `type` | `tipo` |
| `vars` | `variables` |
| `zip` | `acopiar` |
## Exceptions (69 terms)
Exception classes for error handling.
| English | Spanish |
| ------- | ------ |
| `arithmeticerror` | `erroraritm茅tico` |
| `assertionerror` | `errordeaserci贸n` |
| `attributeerror` | `Errordeatributo` |
| `baseexception` | `excepci贸nbase` |
| `baseexceptiongroup` | `grupodeexcepcionesbase` |
| `basegeneratorexit` | `generarsalida` |
| `blockingioerror` | `errordeESbloqueante` |
| `brokenpipeerror` | `errordetuber铆arota` |
| `buffererror` | `errordeb煤fer` |
| `byteswarning` | `advertenciadebytes` |
| `childprocesserror` | `errordeprocesosecundario` |
| `connectionabortederror` | `errordeabortarconexi贸n` |
| `connectionerror` | `errordeconexi贸n` |
| `connectionrefusederror` | `errorderechazodeconexi贸n` |
| `connectionreseterror` | `resetearconexi贸n` |
| `deprecationwarning` | `advertenciadedepreciaci贸n` |
| `encodingwarning` | `advertenciadecodificaci贸n` |
| `environmenterror` | `errordeentorno` |
| `eoferror` | `errordeentradasalida` |
| `exception` | `excepci贸n` |
| `exceptiongroup` | `grupodeexcepciones` |
| `fileexistserror` | `errordeexistenciadearchivo` |
| `filenotfounderror` | `Errordenoencontrarelarchivo` |
| `floatingpointerror` | `errordepunteroflotante` |
| `futurewarning` | `advertenciafutura` |
| `generatorexit` | `salidadegenerador` |
| `importerror` | `errordeimportaci贸n` |
| `importwarning` | `advertenciadeimportaci贸n` |
| `indentationerror` | `errordesangr铆a` |
| `indexerror` | `Errorde铆ndice` |
| `interruptederror` | `errordeinterrupci贸n` |
| `ioerror` | `errordeES` |
| `isadirectoryerror` | `errordedirectorio` |
| `keyboardinterrupt` | `interrupci贸ndelteclado` |
| `keyerror` | `errordeclave` |
| `lookuperror` | `errordeb煤squeda` |
| `memoryerror` | `errordememoria` |
| `modulenotfounderror` | `Errordem贸dulonoencontrado` |
| `nameerror` | `Errordenombre` |
| `notadirectoryerror` | `errordenoserundirectorio` |
| `notimplementederror` | `errordenoimplementaci贸n` |
| `oserror` | `ErrorDeOS` |
| `overflowerror` | `errordedesbordamiento` |
| `pendingdeprecationwarning` | `advertenciadeadvertenciadedepreciaci贸npendiente` |
| `permissionerror` | `errordepermiso` |
| `processlookuperror` | `errordeb煤squedadeproceso` |
| `recursionerror` | `errorderecursi贸n` |
| `referenceerror` | `errordereferencia` |
| `resourcewarning` | `advertenciaderecursos` |
| `runtimeerror` | `errorentiempodeejecuci贸n` |
| `runtimewarning` | `advertenciadetiempodeejecuci贸n` |
| `stopasynciteration` | `detenerlaiteraci贸nasincr贸nica` |
| `stopiteration` | `detener_iteraci贸n` |
| `syntaxerror` | `errordesintaxis` |
| `syntaxwarning` | `advertenciadesintaxis` |
| `systemexit` | `salirdelsistema` |
| `taberror` | `errordetabulaci贸n` |
| `timeouterror` | `errordetiempodeespera` |
| `typeerror` | `errordetipo` |
| `unboundlocalerror` | `errordereferencialocalnoenlazada` |
| `unicodedecodeerror` | `errordedecodificaci贸ndeUnicode` |
| `unicodeencodeerror` | `errordecodificaci贸nunicode` |
| `unicodeerror` | `errordeunicode` |
| `unicodetranslateerror` | `errordetraducci贸ndeUnicode` |
| `unicodewarning` | `advertenciadeunicode` |
| `userwarning` | `advertenciadelusuario` |
| `valueerror` | `errordevalor` |
| `warning` | `advertencia` |
| `zerodivisionerror` | `errordedivisi贸nporcero` |
## Example Code
Here's an example showing Spanish Python code with Legesher:
```python
# Ejemplo: Funci贸n factorial con manejo de errores
desde typing importar Optional
definir factorial(n):
"""Calcular el factorial de n."""
si n < 0:
levantar Errordevalor("Los n煤meros negativos no est谩n permitidos")
si_no n == 0 o n == 1:
devolver 1
sino:
devolver n * factorial(n - 1)
definir principal():
numeros = [entero(x) por x en rango(6)]
por numero en numeros:
resultado = factorial(numero)
imprimir(f"{numero}! = {resultado}")
# Demostrar bucle while
contador = 0
mientras contador < 3:
imprimir(f"Contador: {contador}")
contador += 1
# Demostrar try/except
probar:
factorial(-1)
excepto Errordevalor como error:
imprimir(f"Error: {error}")
finalmente:
imprimir("隆Listo!")
si __name__ == "__main__":
principal()
```
## Usage
```python
from legesher_i18n import LanguagePackLoader
# Load Spanish pack for Python 3.12
loader = LanguagePackLoader()
pack = loader.load("es", "python", "3.12")
# Translate code
from legesher import translate
english_code = translate(your_es_code, from_lang="es", to_lang="en")
```
## Contributing
Found a better translation? We welcome contributions from native speakers!
1. Edit `legesher_i18n_python_es/packs/<version>.yml` for the Python version where the term was introduced:
- `3.10.yml` - Base translations (most terms)
- `3.11.yml` - Terms added in Python 3.11 (e.g., `except*`)
- `3.12.yml` - Terms added in Python 3.12 (e.g., `type`)
- `3.13.yml` / `3.14.yml` - Future additions
2. Submit a pull request with your reasoning
3. Translations should be natural, commonly used in CS education, and easy to type
|