Looks like you trying to execute python code directly in browser...
The most simple way is a JavasScript using, because it fully supported by Browser engine.
However browser don't know what is python
and how to use it. Same thing happens if you try to run python script without python installed on your computer.
In other way it is possible to create independent python binary executable file. That will allow to run python program at client side without python.
So it is possible to create local server
executable and use it as server
url to run operations. But user have to run this server binary manually, and it is looking not smart and pretty insecure.
In other way we have a nice technology WebAssembly that allow us execute compiled code directly in browser. And looks like python also supported with Pyodide
Here is a Hello World
created with Pyodide.
So looks like it is possible to run python without any server. But I guess here is still many limitations in comparison with backend-hosted python