Код: Выделить всё
from importlib.resources import path
import sys
# Assuming 'my_package.lib' is the sub-package containing the DLLs
with path('pyrp.lib', '') as lib_path:
sys.path.append(str(lib_path))
# Now you can import your dependencies as if they were in the same directory
from pythonnet import load
load('coreclr')
import clr
def load_APIStandard():
clr.AddReference("myDLL")
from myDLL import APIStandard
# Return the imported module or any objects you need from it
return APIStandard
Код: Выделить всё
#__init__.pyi
from System import Array_1
from myDLL import AnalysisResult
class APIStandard(abc.ABC):
@staticmethod
def AnalyzeData(data: Array_1[int]) -> AnalysisResult: ...
Код: Выделить всё
"python.analysis.extraPaths": [
"./pyrp/lib/PythonTypes" // Add the path to your "types" directory here, adjust the path as necessary
]
Подробнее здесь: https://stackoverflow.com/questions/787 ... ip-package