I have been playing with pybridge and came up with a scenario that I wanted to import a variable from a second py file using an import. I presume for the usual reasons, File.DirAssets cannot be on the PythonPath and therefore can't import from there.
I thought I would create a directory in the Python directory of the Objects directory and add that to PythonPath. I chose the Python Directory as that gets copied verbatim by the Build Standalone Process.
I tried adding "PYTHONPATH" to the EnvironmentVars, but looking at the code for PyBridge, this gets over written.
You may already have a simpler solution, but if not, could I request amending the PyBridge.Start method to do something similar to this:
Dim PythonPath As String = Options.EnvironmentVars.GetDefault("PYTHONPATH","")
If PythonPath <> "" Then
Options.EnvironmentVars.Put("PYTHONPATH", Options.PyBridgePath & ";" & PythonPath)
Else
Options.EnvironmentVars.Put("PYTHONPATH", Options.PyBridgePath)
End If
Which checks if the PythonPath env has been set and prepends the PyBridgePath.
I have tried this out and it seems to work as expected.