2012-03-07 5 views
2

플랫폼 : Windows 7 둘 다 32 비트 버전이라고 가정합니다.pythondotnet에 스택리스 파이썬 2.7.2를 사용할 수 있습니까?

두 가지 설치 프로세스가 모두 python.exe 자체를 대체하기 때문에 현재로서는 이해할 수 없습니다.

둘 다 기능을 사용하려면 각 소스를 병합해야 할 것 같습니까?

스택리스 파이썬 : .NET 용 http://zope.stackless.com/

파이썬 : http://pythonnet.github.io/

우리가 CPython의 라이브러리의 전체 범위에 대한 액세스를 원하기 때문에 우리는 IronPython을 통해 .NET을위한 파이썬을 사용하는 (예를 들면하기 matplotlib 다른 사람의 사이에서) .

답변

1

당신이 exe를 대체 할 필요가없는 pythondotnet를위한 선택권이있다. 이것은 "시작하기"섹션에서 간단히 언급됩니다 : http://pythonnet.github.io/readme

이렇게하면 스택리스 (exe 수정) 설치를 수행하고 여전히 pythondotnet 기능을 사용할 수 있습니다.

clr.pyd 및 Python.Runtime.dll 파일은 이러한 파일과 수정 된 python.exe를 모두 루트 Python 설치 디렉토리에 복사하는 대신 Python27/DLLs 디렉토리로 복사됩니다.

이것은 모두 x86, btw로 끝났습니다 ... x64 지원은 pythondotnet에서 작동하지만 스택리스 x64 지원은 작동하지 않습니다 ... 소스에서 빌드 한 후 x64 인터프리터를 실행했지만 numpy와 같은 라이브러리가 손상된 것처럼 보였습니다. .

2

당신이 진술 한대로, 불가능합니다. 두 프로젝트의 "소스를 병합"하는 것도 간단한 작업이 아닙니다.

그러나 stackless로 잘 처리되는 문제가 있습니다. 스택없는 Python이 필요한 프로젝트 부분과 필요한 프로젝트의 다른 부분을 작성하는 것이 좋습니다. net을 사용하면 일반 IronPython을 사용할 수 있습니다. xmlrpc (또는 jsonrpc) 호출을 사용하여 프로그램의 두 부분간에 데이터를 comunicate 할 수 있습니다. Python에서는 복잡한 작업이 아니며 Python의 두 가지 유형 (예 : http://code.activestate.com/recipes/81549-a-simple-xml-rpc-server/)

+0

좋은 제안은 불행히도 우리의 응용 프로그램에는 적용되지 않습니다. 또 다른 가능성이있을 수 있습니다. 그것이 효과가 있으면 게시 할 것입니다. 감사. –

+0

2016 업데이트 - 이런 종류의 일을 수행하는 자연스러운 파이썬 "방법"은 셀러리 (http://www.celeryproject.org/)입니다. – jsbueno

1

공식 답변을 구하는 사람은 누구나 "아니오"입니다. PythonDotNet은 Python의 Object 내부 작동을 단계별로 설명합니다.

/// <summary> 
/// TypeFlags(): The actual bit values for the Type Flags stored 
/// in a class. 
/// Note that the two values reserved for stackless have been put 
/// to good use as PythonNet specific flags (Managed and Subclass) 
/// </summary> 
internal class TypeFlags { 
    public static int HaveGetCharBuffer = (1 << 0); 
    public static int HaveSequenceIn = (1 << 1); 
    public static int GC = 0; 
    public static int HaveInPlaceOps = (1 << 3); 
    public static int CheckTypes = (1 << 4); 
    public static int HaveRichCompare = (1 << 5); 
    public static int HaveWeakRefs = (1 << 6); 
    public static int HaveIter = (1 << 7); 
    public static int HaveClass = (1 << 8); 
    public static int HeapType = (1 << 9); 
    public static int BaseType = (1 << 10); 
    public static int Ready = (1 << 12); 
    public static int Readying = (1 << 13); 
    public static int HaveGC = (1 << 14); 
    // 15 and 16 are reserved for stackless <- quote from the python source 
    public static int HaveStacklessExtension = 0; 
    /* XXX Reusing reserved constants */ 
    public static int Managed = (1 << 15); // PythonNet specific 
    public static int Subclass = (1 << 16); // PythonNet specific