↓のプログラムを .NET 4 で動かしてみたらば……
C:\XNA\python>"C:\Program Files\IronPython 2.6 for .NET 4.0\ipy.exe" template.py Traceback (most recent call last): File "template.py", line 10, in <module> IOError: System.IO.FileLoadException: 混合モード アセンブリはバージョン 'v2.0.50727' のランタイムに対して作成されており、追加の構成情報がないと 4.0 ランタイムでは読み込めません。 場所 Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) 場所 IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) 場所 IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) 場所 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) 場所 Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) 場所 IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) 場所 IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) 場所 IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) 場所 IronPython.Hosting.PythonCommandLine.RunFile(String fileName)
orz
.NET のアセンブリって上位互換じゃなかったのか……。
CPython の C 拡張が例えば
Downloads
- pygame-1.9.1release.win32-py2.4.exe 3MB
- pygame-1.9.1release.win32-py2.5.exe 3MB
- pygame-1.9.1.win32-py2.5.msi 3MB (python2.5.4 is the best python on windows at the moment)
- pygame-1.9.1.win32-py2.6.msi 3MB
- pygame-1.9.1.win32-py3.1.msi 3MB
- (optional) Numeric for windows python2.5 (note: Numeric is old, best to use numpy) http://rene.f0o.com/~rene/stuff/Numeric-24.2.win32-py2.5.exe
- windows 64bit users note: use the 32bit python with this 32bit pygame.
みたく、Python の方のバージョンが違う毎に別々にバイナリを用意しなくてはならない事態になってるみたいなんですけど*1それが .NET(MSIL) なら回避できるんじゃないかなーとか甘いこと期待してたのですが……こっちもこうですかそうですか。orz
*1:回避する方法もありそうではありますが → 第9回 Python3にもC拡張モジュールを─Python3.0でも使える拡張モジュール開発手法の確立:Python 3.0 Hacks|gihyo.jp … 技術評論社