Running a Python Script Through Unity3D C# Script

Hey!

So I am trying to make a game that will need to access a bunch of info from a RESTfull web API. I wrote a python script that accesses all of the info I need and rewrites a text file that I can process with C# in unity. The only problem is that I don’t know how to run the python code from unity. I also am not sure how I would package the python code with the game or if that is even possible since unity does not compile python.

I am reluctant to access the web APIs through C# since I am making this game for a python based class and I am sure my prof would rather some of the project be in python. If that is the only option I am open to doing that, but a point in the right direction would be nice since I am not sure about how unity works with web APIs.

Project is due on the 10th, so I have a little bit of time and can work on other parts of the game until I learn how to do this. But time is a bit more rushed than I would like.

Thanks!!
-Max

http://www.secretgeek.net/host_ironpython

1 Like

That looks really helpful. Is having ironpython in unity as easy as dragging the engine into my unity game files?

I don’t know what you mean by dragging the engine(dll’s?), take a look here there is a version of iron python on the asset store that has access to all the unity API’s as well.

http://u3d.as/content/noam-gat/python-interpreter/1Qb

1 Like

More or less. The performance isn’t going to be good though.