在Kotlin服务器上启动用于Android应用的Python脚本?

huangapple go评论61阅读模式
英文:

Launching Python scripts on Kotlin server for Android app?

问题

如何在Android客户端上使用Kotlin服务器端代码同时启动多个客户端的Python脚本?

我正在开发一个Android应用,客户端和服务器端都使用Kotlin编写。
然而,我想要使用一些Python的NLP库。这对于手机上任何客户端的文本输入是必需的,我需要将其发送到服务器进行NLP处理,并根据客户端的需求提供结果。
请注意,在任何给定时间可能会有成千上万个客户端,并且我的服务器应该处理所有请求。
我应该使用Ktor来处理多个客户端吗?
如何为每个客户端启动Python代码?

英文:

Tldr; how to launch python scripts for multiple clients at the same time using Kotlin server side code for Android clients.

I am developing an Android app using Kotlin for client side as well as server side code.
However, I want to use some libraries for NLP using Python. This is required for text input by any client on the phone, I need send that to the server for NLP processing and give result to the client accordingly.
Note that there can thousands of clients at a given time and my server should handle all the requests.
Should I use Ktor for handling multiple clients?
How to launch python code for each client?

答案1

得分: 1

找到了解决方案 - https://chaquo.com/chaquopy/
对我来说非常有效。

英文:

Spent a long time to figure this out, but found a solution - https://chaquo.com/chaquopy/

Works for me like a charm.

huangapple
  • 本文由 发表于 2023年5月28日 03:00:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76348551.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定