Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!