Skip to content
Advertisement

How to add in react-native script in python?

Also i have got a new project, where nedded make a voice recognition (speech-to-text) , but i have’t find a worked library in react-native. How can i connect scripts in python to react native project?

I only find how to make autorizathion in python, but by me it was maked in JS

Advertisement

Answer

If your python app is going to be running on a separate machine to the react-native app (so it is running on a server). I would write a small server implementation ontop of the python app using something like flask which sends back a JSON then you can follow the tutorial here: https://reactnative.dev/docs/network Which talks about making http requests and parsing the response. So in a REST api manner

If you are talking about client side python running in tandem with react-native on a mobile device. That would be pretty difficult to accomplish as in production the react compile is compiling into native code by handling JavaScript/JSX and not python. Someone may have an answer on this last part

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement