Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed Python/C++ code in React Native?

I am planning on working on a personal project where I utilize React native for most of the Business Logic and Front End.

I want it to work on Windows 10, but it would be great if it was compatible with IOS/Android as well.

While I know React native itself has that capability, the catch here is that I want to utilize heavy machine learning throughout the project in Python for now, and then perhaps C++.

I did some research and many people suggested running a flask server and calling the Python code via its API. The problem with that is that that then delegates the machine learning tasks to the server, and not the client.

1) Is there a way to "embed" the python server to only exist in the React-Native back-end (Node js) environment? Or perhaps in this case it just calls a python script and awaits results?

2) Is is possible to achieve this task while also packaging it in a '.exe' or '.apk' file?

like image 622
NutellaAddict Avatar asked Nov 07 '22 11:11

NutellaAddict


1 Answers

I'm interested in re-using some Python code, take a look at http://www.transcrypt.org, which promises cross-compilation of Python to JavaScript.

like image 174
Big Rich Avatar answered Nov 14 '22 21:11

Big Rich