Search Unity

Running python script from Unity

Discussion in 'Scripting' started by KushMathur, Aug 28, 2019.

  1. KushMathur

    KushMathur

    Joined:
    Jul 3, 2019
    Posts:
    22
    Hey Team!

    I have been working on a project, in which I am supposed to call a python script from Unity to calculate something.

    Unfortunately, I don't know any way to do it:confused:, please all your suggestions are welcome...

    Thanks everyone!!
     
  2. KushMathur

    KushMathur

    Joined:
    Jul 3, 2019
    Posts:
    22
    In general, I have a script called "//MyFolder//temporary.py", out somewhere, and I want to write a c# script in Unity so that it will run this python script.
     
  3. tcmeric

    tcmeric

    Joined:
    Dec 21, 2016
    Posts:
    190
  4. KushMathur

    KushMathur

    Joined:
    Jul 3, 2019
    Posts:
    22
    Ah! It is good if I can run python on my c# scripts. I can either copy my python script and run it directly on CS script using Iron Python(is it powerful enough to run big .py scripts?) or is their any way a command or an example somewhere which can be used to directly import the .py file and then it can run on its own.

    Thanks a lot though!