Urgent.News

What's breaking now, across thousands of outlets.

Tech

Pyrtugues: programação em português que gera Python de verdade

Pyrtugues: A Ponte em Português para o Python que Crianças e Iniciantes Precisavam Se você já tentou ensinar programação para uma criança ou para alguém que não fala inglês, sabe qual é o maior obstáculo: a barreira do idioma. Enquanto a lógica de programação é universal, os comandos como if , else , print e def são em inglês. Ferramentas como o Portugol tentam resolver isso, mas trazem uma…

Pyrtugues is an open-source educational project designed to bridge the gap between Portuguese-speaking programmers and the Python programming language. For children or beginners who don't speak English, one of the biggest challenges in learning programming is the language barrier. While the logic behind programming is universal, commands like if, else, print, and def are all in English.

Pyrtugues aims to solve this issue by providing a tool that allows users to write code in Portuguese while maintaining the same logic as Python. The tool then automatically translates the Portuguese code into real Python code, which can be executed and even use the Pygame library to create games.

The architecture of Pyrtugues is simple and powerful. Users write code in Pyrtugues, such as:

If age is 10:

Display "Olá!"

The translation engine then converts this to Python:

If age is 10:

Print "Olá!"

The Python code can then be executed, allowing users to see the real results of their code.

Here's a practical example:

In Pyrtugues:

Function greet(name):

Return "Olá, {name}!"

Display greet("Pyrtugues")

In Python (generated automatically):

Def greet(name):

Return "Olá, {name}!"

Print greet("Pyrtugues")

The logic remains the same, with only the syntax changing to make it more user-friendly for beginners. Pyrtugues stands out by not using blocks, being a true textual programming language, bridging to Python, supporting Pygame for creating games and graphical applications, and being available as a web and desktop version.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Sunday 27 September →