- Home /
Combining python and Unity 3D
To make this short and simple. I have TCP socket in my unity project that receives communication from a python script (in a separate python app, using Spyder right now). Is it possible to somehow combine these two programs into one concise app?
I am pretty sure Unity does not have this capability built in (if it does please let me know). Is there a work around? Am I able to create like an umbrella app using different software to start up both programs.
if its a mobile app you can export to android studio / xcode. may i ask why are you using 2 different editors/ languages?
The python program access cameras and searches for codes, people and so on, then transmits information to unity and unity reacts to the information and displays what is needed. The python was written separately because unity does not have support python code (or at least enough of the functions of python to be effective). So would android studios allow me to combine my python and unity into a bundled app?
You could have two dependant builds such as having the python build write the info to a .txt or .json file then have the unity standalone read it.
Answer by Cornelis-de-Jager · Apr 02, 2019 at 03:49 AM
Unfortunately there is no easy way to do this. The reason other languages like JavaScript works in the same Dev environment as Unity is due to both being supported by DotNet. Python is not supported on dotnet.
However, there is a way to communicate between the applications. This still won't be one application, but rather they are just in the same folder. The way to do this is through PowerShell. Send and receive information to and from powershell using C#. PowerShell by extension can call and recieve inputs and outputs from Python.
its not an easy thing to do but it is possible.
I figured this wouldn't be easy, I am just looking for some leads on where to start. So in theory could I use powershell to orchestrate opening both the python script and Unity app in the order I need them to? Does powershell work on phones?
Your answer
![](https://koobas.hobune.stream/wayback/20220612194653im_/https://answers.unity.com/themes/thub/images/avi.jpg)