Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In a client-server architecture, the backend is what runs on the server. Frontend - what works for the client ("thick client").
And this and that can be written on anything, if there are appropriate mechanisms.
Backend - Python. This is fine. The universal version returns data on request and does not worry about how they will be visualized. REST, GraphQL, SOAP, etc.
Frontend, working on the client side, visualizes the received data for the user. Here, both native rendering and indirect rendering (for example, through a browser) are possible.
The frontend is written separately from the backend. Tool - any suitable.
To render through a browser (here, the Toaster site, for example), you need to write a client in HTML / CSS / JS. It will be loaded into the browser and drawn by means of it.
For native rendering - any lib corresponding to the system. At least MFC is in Windows (although this is already necromancy - now .NET libraries are in favor), at least Carbon (or what is there now on the Mac?).
From Linux native (they are also cross-platform), GTK, Qt, FLTK and various add-ons above them are suitable. WxWidget is the same...
I'm not touching the topic of mobile devices yet...
Therefore, if you don't want to learn different languages, but limit yourself to Python, then you CAN write on it. There are bindings for GTK and Qt. There is WxPython. For mobile phones, you can immerse yourself in the marvelous and wonderful world of Kivy (although this is rather a cross-platform solution - it will work on desktops as well). BeeWare is also developing interestingly.
But if writing a web client is meant, then learning JS will take less time than fruitless attempts to use the wrong tool.
write your own browser with python support and I think it will be possible
The front end is what works in the user's browser.
Python doesn't work in browser.
Hence the conclusion: no, you can't.
Well, there are probably various translators (or compilers, whatever you want to call it) that convert python code to JS. But you see, the language is part of the ecosystem, and you will have difficulty using other people's libraries that use their types (their own type conversion nuances), and it's not a fact that you can use other people's libraries at all.
Therefore, it seems to me that you will later regret a million times that you began to use such a "crutch". Learn JS, sometimes it's good to learn other programming languages.
Well, for example, you can tie webpack to django:
https://github.com/saintbyte/django_webpack_integration
You can look towards WebAssembly. There is no implementation for python yet (maybe there won't be). But the direction can be interesting.
Can. There is a WebCode library for this, but it does not interact directly with the browser, it only generates html and css. More: https://habr.com/en/sandbox/141376/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question