From gregoire.dooms at gmail.com Fri May 1 17:50:05 2009 From: gregoire.dooms at gmail.com (=?ISO-8859-1?Q?Gr=E9goire_Dooms?=) Date: Fri, 1 May 2009 16:50:05 +0100 Subject: [Python.NET] tuple not recognized as a type ? Message-ID: <978977470905010850s49b9f54aqfe3366ef18fa7441@mail.gmail.com> Hello, I have been trying to use tuple as a generic type argument: In [4]: from System.Collections.Generic import List In [5]: In [6]: x = List[int](range(4)) In [7]: x = List[tuple]([() for t in range(4)]) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) h:\python\testPyNet.py in () ----> 1 2 3 4 5 TypeError: type(s) expected I had a similar problem in a generic method of a non-generic class. I have two questions: * Is there a work around ? * How do you debug python for .NET ? I tried to attach a Visual Studio 2005 debugger to the python process and break in ClassObject.type_subscript but VS does not load the symbols. Thanks for this project, I would love to use it. -- Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From btribble at ea.com Fri May 1 19:29:45 2009 From: btribble at ea.com (Tribble, Brett) Date: Fri, 1 May 2009 10:29:45 -0700 Subject: [Python.NET] tuple not recognized as a type ? In-Reply-To: <978977470905010850s49b9f54aqfe3366ef18fa7441@mail.gmail.com> References: <978977470905010850s49b9f54aqfe3366ef18fa7441@mail.gmail.com> Message-ID: If you have your .net assembly put up a modal dialog (messagebox), you can attach to the process from DevStudio, set breakpoints, etc. From: pythondotnet-bounces+btribble=maxis.com at python.org [mailto:pythondotnet-bounces+btribble=maxis.com at python.org] On Behalf Of Gr?goire Dooms Sent: Friday, May 01, 2009 8:50 AM To: pythondotnet at python.org Subject: [Python.NET] tuple not recognized as a type ? Hello, I have been trying to use tuple as a generic type argument: In [4]: from System.Collections.Generic import List In [5]: In [6]: x = List[int](range(4)) In [7]: x = List[tuple]([() for t in range(4)]) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) h:\python\testPyNet.py in () ----> 1 2 3 4 5 TypeError: type(s) expected I had a similar problem in a generic method of a non-generic class. I have two questions: * Is there a work around ? * How do you debug python for .NET ? I tried to attach a Visual Studio 2005 debugger to the python process and break in ClassObject.type_subscript but VS does not load the symbols. Thanks for this project, I would love to use it. -- Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From blloyd at waterfrontmedia.com Fri May 1 20:20:56 2009 From: blloyd at waterfrontmedia.com (Brian Lloyd) Date: Fri, 01 May 2009 14:20:56 -0400 Subject: [Python.NET] tuple not recognized as a type ? In-Reply-To: Message-ID: Hi Brett ? Generics only work with CLR types and primitive Python types that have a direct CLR equivalent (string, int, etc.), so you really can?t do this with tuples. Not sure what you were going for in the example, but generally you will want to use CLR collection types when interacting with CLR objects and apis. For debugging your best bet would be vstudio for looking at the integration layer, but YMMV given all the transitions between managed code, native code, generated code, etc. hope this helps, -Brian On 5/1/09 1:29 PM, "Tribble, Brett" wrote: > If? you have your .net assembly put up a modal dialog (messagebox), you can > attach to the process from DevStudio, set breakpoints, etc. > > > From: pythondotnet-bounces+btribble=maxis.com at python.org > [mailto:pythondotnet-bounces+btribble=maxis.com at python.org] On Behalf Of > Gr?goire Dooms > Sent: Friday, May 01, 2009 8:50 AM > To: pythondotnet at python.org > Subject: [Python.NET] tuple not recognized as a type ? > > Hello, > > > > I have been trying to use tuple as a generic type argument: > > In [4]: from System.Collections.Generic import List > > In [5]: > > In [6]: x = List[int](range(4)) > > In [7]: x = List[tuple]([() for t in range(4)]) > > --------------------------------------------------------------------------- > > TypeError Traceback (most recent call last) > > > > h:\python\testPyNet.py in () > > ----> 1 > > 2 > > 3 > > 4 > > 5 > > > > TypeError: type(s) expected > > > > I had a similar problem in a generic method of a non-generic class. > > > > I have two questions: > > * Is there a work around ? > > * How do you debug python for .NET ? > > I tried to attach a Visual Studio 2005 debugger to the python process and > break in ClassObject.type_subscript but VS does not load the symbols. > > > > Thanks for this project, I would love to use it. > > -- > > Greg > > > > > > > > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------------------- Brian Lloyd 540.845.2975 blloyd at waterfrontmedia.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume.buisson at ubisoft.com Tue May 12 16:04:27 2009 From: guillaume.buisson at ubisoft.com (Guillaume Buisson) Date: Tue, 12 May 2009 16:04:27 +0200 Subject: [Python.NET] Python.Runtime as a reference in my C# project Message-ID: Hello I'm trying to develop a python console in WPF : to do it I have to execute a C# string as a python expression. 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. It turns out that the "Console" project inside pythonnet solution has the same issue. Does it work for you? Thanks Guillaume Ps: System.BadImageFormatException was unhandled Message="Tentative de chargement d'un programme de format incorrect. (Exception de HRESULT : 0x8007000B)" Source="Python.Runtime" StackTrace: ? Python.Runtime.Runtime.Py_Initialize() ? Python.Runtime.Runtime.Initialize() dans D:\pythonnet\trunk\pythonnet\src\runtime\runtime.cs:ligne 70 ? Python.Runtime.PythonEngine.Initialize() dans D:\pythonnet\trunk\pythonnet\src\runtime\pythonengine.cs:ligne 118 ? Python.Runtime.PythonEngine.InitExt() dans D:\pythonnet\trunk\pythonnet\src\runtime\pythonengine.cs:ligne 150 ? 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 ? System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) ? System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args) ? System.Windows.Controls.Button.OnClick() ? System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) ? System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) ? System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) ? System.Windows.UIElement.ReRaiseEventAs(RoutedEventArgs args, RoutedEvent newEvent) ? System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) ? System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) ? System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) ? System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args) ? System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) ? System.Windows.Input.InputManager.ProcessStagingArea() ? System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) ? System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) ? System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) ? System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) ? System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) ? MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) ? MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) ? System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) ? System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) ? System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) ? MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) ? MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) ? System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg) ? System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) ? System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) ? System.Windows.Application.RunInternal(Window window) ? System.Windows.Application.Run(Window window) ? ProtoCPython.App.Main() dans C:\Users\guillaume.buisson\Documents\Visual Studio 2008\Projects\ProtoCPython\ProtoCPython\obj\Debug\App.g.cs:ligne 0 ? System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) ? Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() ? System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) ? System.Threading.ThreadHelper.ThreadStart() InnerException: -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume.buisson at ubisoft.com Tue May 12 15:45:46 2009 From: guillaume.buisson at ubisoft.com (Guillaume Buisson) Date: Tue, 12 May 2009 15:45:46 +0200 Subject: [Python.NET] python 3.0 Message-ID: Hi everybody ! We are looking forward for using python for .Net in our project. I am very impressed by the library that is working today on .Net 3.5 (WPF and co) and python 2.6 virtually without any commit for the last couple of years! J Still, what do you think about python 3.0? Have you ever tried to be compatible with it? Is there any big issue you have already imagine? Thanks Guillaume -------------- next part -------------- An HTML attachment was scrubbed... URL: From blloyd at waterfrontmedia.com Tue May 12 16:26:00 2009 From: blloyd at waterfrontmedia.com (Brian Lloyd) Date: Tue, 12 May 2009 10:26:00 -0400 Subject: [Python.NET] python 3.0 In-Reply-To: Message-ID: Hi Guillaume ? the runtime is very sensitive to internal structural changes in the CPython runtime, so I?m sure there would be some work involved. Some things I can think of off the top of my head: - unicode changes / bytes type (this could be a giant pain) - int / long unification - need to support views and iterators - exception hierarchy changes - extension api changes It?s probably enough work that it will take someone committed and invested to make it happen... -Brian On 5/12/09 9:45 AM, "Guillaume Buisson" wrote: > Hi everybody ! > We are looking forward for using python for .Net in our project. I am very > impressed by the library that is working today on .Net 3.5 (WPF and co) and > python 2.6 virtually without any commit for the last couple of years! J > Still, what do you think about python 3.0? Have you ever tried to be > compatible with it? Is there any big issue you have already imagine? > > Thanks > Guillaume > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------------------- Brian Lloyd 540.845.2975 blloyd at waterfrontmedia.com -------------- next part -------------- An HTML attachment was scrubbed... URL: