일반 파이썬 (.py) 파일과 Visual Studio C# 파일 (.cs)의 두 파일이 있습니다. 파이썬 파일에서 문자열을 반환하고 C# 파일에서 해당 문자열을 사용하는 함수를 사용하고 싶습니다.파이썬 파일에서 메서드 사용
는 기본적으로 :
#This is the Python file!
def pythonString():
return "Some String"
및
//This is the C# file!
namespace VideoLearning
{
string whatever = pythonString(); // This is from the Python file.
}
어떻게 종류의이 두 파일을 링크 할 수 있습니까? 감사.
그것은 쉬운 일이 아니다. IronPython을 사용하여 .NEt 호환 개체를 만들 수 있습니다.이 개체는 C# 프로젝트에서 사용할 수 있습니다. http://ironpython.net/documentation/dotnet/dotnet.html#declaring-net-types – jessehouwing