1

How could I or would it be appropriate to integrate Python code with HTML/CSS/JS as the user interface in creating desktop applications. A simple example; if I wanted to created a function with Python that prints "Hello World!" and use HTML/CSS/JS to create a user interface (make it fancy, perhaps add some images), so I can use it as a desktop application. How would I go about this?

I understand I could use libraries such as Tkinter, but it doesn't allow the flexibility of customising user interface.

I've read about using Electron, but I haven't seen many people using Python as the back-end. Any help or information in relation to using Python as a back-end with HTML/CSS/JS as the user interface will be greatly appreciated.

4
  • Don't know you tagged this question with Java, but Django is a popular python web framework. Commented Feb 27, 2020 at 4:33
  • My mistake, it was suppose to be Javascript. Commented Feb 27, 2020 at 4:34
  • Python as a back-end, are you referring to web framework or desktop application ? because you asked user interface in creating desktop applications Commented Feb 27, 2020 at 4:34
  • More specifically as a desktop application, using Python as a back-end. Is it called GUI for desktop applications, not UI? Commented Feb 27, 2020 at 4:35

2 Answers 2

2

You're best option is to look at Flask (Almost no learning curve) as a backend and you can continue using HTML/CSS/JS as frontend.

However to create a desktop application you will need to integrate (Your frontend) with tools like electron.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your reply. I've definitely heard about Flask in the past, what is the main difference between using Flask instead of Python as a back-end? Also, when creating the desktop application, I add both the back-end (flask) and front-end into one, singular Electron app? I was looking at one of the simple Electron app's repository and there seem to only be a html, javascript, css and json file, what serves as the back-end for this particular application? (the app was converting letter input into hash values) Thanks again.
Hey, Flask is a library to help you use python as a backend easily. You add the backend on a web server (server-side) and you package HTML + CSS + JS with electron and you create your required desktop apps (Client Side). I hope that helps.
Thanks Rahul, you explained it well. I understand it now.
I am glad I could help you. It would be great if you could mark my answer as accepted if it helped you.
0

Yes you can. You need to choose framework of python. like Django etc. Then you can make own desktop application as you can.

3 Comments

With the tutorials I've been following, they refer to Django as a framework to create websites and web apps. Could I use it to create Python-based desktop applications as well?
Sorry dude, My english is not good. But you can make desktop applications using python.
That is fine. Thanks for your recommendation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.