-2

My python code is just a library(group of files). For every API call I want to run 5 or more parallel calls to form the data. Is there any way i can write multithreading tasks without any server ?

Edit - The code is not deployed to any server. The zipped code is used by client. So in this case we dont the way how the client servers are configured.

CodeCool
  • 193
  • 2
  • 12
  • `server` is more conceptual. What ever app you create to serve on an endpoint, that becomes a server :-). If your question was about using any available servers, mult-threading and servers does not relate directly. – Kris Jun 14 '22 at 06:30
  • "Server" is no more than a role of a device. – Klaus D. Jun 14 '22 at 06:30
  • [multiprocessing](https://docs.python.org/3/library/multiprocessing.html) – Ouroborus Jun 14 '22 at 06:30
  • I have edited it. multithreaded code requires additional memory storage. The code is used by client so I dnt know the storage or cpu or any other configuration – CodeCool Jun 14 '22 at 06:40

1 Answers1

0

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

rzlvmp
  • 7,512
  • 5
  • 16
  • 45