Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

254
Visualizações
Simplest way to convert python console app to web app

I'm working on text game project in Python. Currently i have finished console app + sqlite database. Now I want to convert console app to web app - it will be the first web app in my life.

I want to create a simple GUI. With main logo, background image, several buttons and text zones. Example of simple GUI project: simple gui project

I would like the logic of the application to be based on the code already created for console application. For example, by replacing the current console functions (for example print) with a function that returns data in the form of JSON. But without changing the internal logic of the function already written in Python. Is it possible? What is the easiest way (and what technologies?) to do that?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

converting a python application to a web application is not a very practical task in some cases.

I think you should use something like Flask or Django but if you don't want to complicate your life too much, there may be an alternative, and it's called PyPy.js

The first things that you must take into account in the logic of web applications, is that HTML is the skeleton of what you are going to show, so you must study it, Javascript adds dynamism to your page, such as animations and data updates without reloading the page, and the CSS to add styles to your html tags.

<head>
  <script src="http://pypyjs.org/pypyjs-release/lib/Promise.min.js"></script>
  <script src="http://pypyjs.org/pypyjs-release/lib/FunctionPromise.js"></script>
  <script src="http://pypyjs.org/pypyjs-release/lib/pypyjs.js"></script>
</head>
<body>
<script type="text/javascript">
  pypyjs.exec(
    // Run Python code
    'y = "hellow" '
  ).then(function() {
    // transferring the variables we need to Javascript, in this case only 'y'.
    return pypyjs.get('y');
  }).then(function(result) {
    // Display an alert like print in Python
    alert(result);
  });
</script>
</body>

that would be the same as ...

y = "hellow"
print (y)
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda