Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question call python3 file from C#

Discussion in 'Scripting' started by zeesh1979, Nov 8, 2023.

  1. zeesh1979

    zeesh1979

    Joined:
    Nov 5, 2023
    Posts:
    1
    Hi,
    I have a python file that uses cvzone package to get webcam data and then send to unity. i have to run this python file first and then play unity game. is there any way i can call that python file when the game starts? i dont have to integrate the communication between c# and python as python file itself sending data to unity. This is what the python and unity do: Video

    Thanks
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,078
    On Windows/Desktop platforms you can use the Process class to start an external process. However you would need to bundle the Python library as you cannot rely on Python installed (and in the correct version) on a user‘s system.
     
    Bunny83 and CodeRonnie like this.