<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>Hello<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US>I&#8217;m trying to develop a python
console in WPF : to do it I have to execute a C# string as a python expression.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>When I initialize the python engine (python
2.6), I get an exception (incorrect format). If I delete the python26.dll, it
is asking for it, so it must be a version issue but I really have no clue to
solve it.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>It turns out that the &#8220;Console&#8221;
project inside pythonnet solution has the same issue.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Does it work for you?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Thanks<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Guillaume<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Ps:<o:p></o:p></span></p>

<p class=MsoNormal>System.BadImageFormatException was unhandled<o:p></o:p></p>

<p class=MsoNormal>  Message=&quot;Tentative de chargement d'un programme de
format incorrect. (Exception de HRESULT : 0x8007000B)&quot;<o:p></o:p></p>

<p class=MsoNormal>  Source=&quot;Python.Runtime&quot;<o:p></o:p></p>

<p class=MsoNormal>  StackTrace:<o:p></o:p></p>

<p class=MsoNormal>       à Python.Runtime.Runtime.Py_Initialize()<o:p></o:p></p>

<p class=MsoNormal>       à Python.Runtime.Runtime.Initialize() dans
D:\pythonnet\trunk\pythonnet\src\runtime\runtime.cs:ligne 70<o:p></o:p></p>

<p class=MsoNormal>       à Python.Runtime.PythonEngine.Initialize() dans
D:\pythonnet\trunk\pythonnet\src\runtime\pythonengine.cs:ligne 118<o:p></o:p></p>

<p class=MsoNormal>       à Python.Runtime.PythonEngine.InitExt() dans
D:\pythonnet\trunk\pythonnet\src\runtime\pythonengine.cs:ligne 150<o:p></o:p></p>

<p class=MsoNormal>       à ProtoCPython.Window1.Button_Click(Object sender,
RoutedEventArgs e) dans C:\Users\guillaume.buisson\Documents\Visual Studio
2008\Projects\ProtoCPython\ProtoCPython\Window1.xaml.cs:ligne 29<o:p></o:p></p>

<p class=MsoNormal>       <span lang=EN-US>à
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs
args, Boolean reRaised)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Controls.Button.OnClick()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs
e)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs
args, Boolean reRaised)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à System.Windows.UIElement.ReRaiseEventAs(RoutedEventArgs
args, RoutedEvent newEvent)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs
args, Boolean reRaised)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Input.InputManager.ProcessStagingArea()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr
hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32
y, Int32 wheel)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32
msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg,
IntPtr wParam, IntPtr lParam, Boolean&amp; handled)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr
lParam, Boolean&amp; handled)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,
Object args, Boolean isSingleParameter)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object
source, Delegate callback, Object args, Boolean isSingleParameter, Delegate
catchHandler)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority,
TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam,
IntPtr lParam)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG&amp; msg)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG&amp; msg)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Windows.Application.RunInternal(Window window)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à System.Windows.Application.Run(Window
window)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       </span>à ProtoCPython.App.Main()
dans C:\Users\guillaume.buisson\Documents\Visual Studio
2008\Projects\ProtoCPython\ProtoCPython\obj\Debug\App.g.cs:ligne 0<o:p></o:p></p>

<p class=MsoNormal>       <span lang=EN-US>à
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>       à System.Threading.ThreadHelper.ThreadStart()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>  InnerException:<o:p></o:p></span></p>

</div>

</body>

</html>