From nigel_midd_76 at hotmail.com Fri Feb 1 14:26:12 2013 From: nigel_midd_76 at hotmail.com (nigel middleman) Date: Fri, 1 Feb 2013 13:26:12 +0000 Subject: [python-win32] [ANN] pywin32 build 218 released. Message-ID: Hi Mark Hope you can help I' am a 3D artist who creates scripts for Maya and I' am wanting to use the Pyhton-win32 to library. I' am using Maya 2013.5 which requires python 2.6 but the version supplied via the vendor has been compiled in VS2010 requiring all libraries to be recompiled in this version of Visual Studio. This is a bit of a long shot but would you have a version of python-win32 for WIN64 compiled in VS2010 for python 2.6. If you are able to be of any assistance with this I would be truly grateful. Regards Nigel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Fri Feb 1 19:26:57 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Fri, 01 Feb 2013 13:26:57 -0500 Subject: [python-win32] [ANN] pywin32 build 218 released. In-Reply-To: References: Message-ID: <510C08F1.4000605@gmail.com> On 1/02/2013 8:26 AM, nigel middleman wrote: > Hi Mark > > Hope you can help I' am a 3D artist who creates scripts for Maya and I' > am wanting to use the Pyhton-win32 to library. I' am using Maya 2013.5 > which requires python 2.6 but the version supplied via the vendor has > been compiled in VS2010 requiring all libraries to be recompiled in this > version of Visual Studio. > > This is a bit of a long shot but would you have a version of > python-win32 for WIN64 compiled in VS2010 for python 2.6. I don't - unfortunately it would be a little painful to do as none of the Python build tools, which pywin32 uses, support building with the non-default compiler. You really should contact the vendor - all Python extensions will have the same issue, so the best fix is simply for them to use the correct compiler. Mark > > If you are able to be of any assistance with this I would be truly grateful. > > Regards > Nigel. > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From rsavutiu at gmail.com Wed Feb 6 10:27:54 2013 From: rsavutiu at gmail.com (Radu Savutiu) Date: Wed, 6 Feb 2013 11:27:54 +0200 Subject: [python-win32] win32gui.EnumWindows does not work on worker threads In-Reply-To: References: Message-ID: I appreciate answers received, however none worked for me. It turned out replacing win32gui.EnumWindows with ctypes.windll.user32.EnumWindows - and then it worked. Maybe there is an error with win32gui's implementation? The code is really vast, I can't post it. On Mon, Jan 28, 2013 at 5:34 PM, Radu Savutiu wrote: > Hi all, > > I have multiple scripts in which i used win32gui.EnumWindows. > So far they all worked - but now it seems they pause on this call to > EnumWindows. > > I suspect this has nothing to do with pythoncom, as I use CoInitialize > there and it works. > > Any ideas? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rupole at hotmail.com Wed Feb 6 12:57:21 2013 From: rupole at hotmail.com (Roger Upole) Date: Wed, 6 Feb 2013 06:57:21 -0500 Subject: [python-win32] win32gui.EnumWindows does not work on workerthreads References: Message-ID: What version of Pywin32 are you running ? There was a recent change to fix a problem with win32gui.EnumWindows in build 218. Roger "Radu Savutiu" wrote in message news:CABJn2YikLtaKUggLR7Fmh2Gbc7vU+OHf_gac8KP3iYwNw3yLLw at mail.gmail.com... >I appreciate answers received, however none worked for me. It turned out > replacing win32gui.EnumWindows with ctypes.windll.user32.EnumWindows - and > then it worked. > > Maybe there is an error with win32gui's implementation? > > The code is really vast, I can't post it. > > > On Mon, Jan 28, 2013 at 5:34 PM, Radu Savutiu wrote: > >> Hi all, >> >> I have multiple scripts in which i used win32gui.EnumWindows. >> So far they all worked - but now it seems they pause on this call to >> EnumWindows. >> >> I suspect this has nothing to do with pythoncom, as I use CoInitialize >> there and it works. >> >> Any ideas? >> > -------------------------------------------------------------------------------- > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From jmfrank63 at gmail.com Wed Feb 6 17:07:23 2013 From: jmfrank63 at gmail.com (Johannes Frank) Date: Wed, 6 Feb 2013 17:07:23 +0100 Subject: [python-win32] pythonwin not catching all events Message-ID: Hello Newsgroup, I am currently programming ProgeCAD an AutoCAD Clone and having difficulties catching all events. My code: import win32com.client import pythoncom,pywintypes import time import tkFileDialog import tkSimpleDialog import IntelliCAD import sys icad_CLSID = '{77E49E57-976B-11CF-8CCB-00A0245B09EB}' icad_ProgID = 'Icad.Application' icad_mod = win32com.client.gencache.EnsureModule(icad_CLSID, 0,1,0) defaultNamedOptArg=pythoncom.Empty defaultNamedNotOptArg=pythoncom.Empty defaultUnnamedArg=pythoncom.Empty class WorkspaceEvents(IntelliCAD._IcadWorkspaceEvents): def __init__(self, oobj=None): IntelliCAD._IcadWorkspaceEvents.__init__(self, oobj) # If you create handlers, they should have the following prototypes: def OnBeginFileDrop(self, FileName=defaultNamedNotOptArg, Cancel=pythoncom.Missing): print 'OnBeginFileDrop Occurs when a file is dropped on the application window' def OnNewDrawing(self): print 'OnNewDrawing Occurs when a new drawing is about to be created' def OnAddinRun(self, AddinFunctionName=defaultNamedNotOptArg): print 'OnAddinRun Occurs when the user runs an add-in function from the command line' def OnEndModal(self): print 'OnEndModal Occurs when a modal dialog is closed' def OnExit(self): print 'OnExit Occurs when the application is about to exit.' def OnLispCancelled(self): print 'OnLispCancelled Occurs when evaluation of a LISP expression is cancelled' def OnNew(self, NewDocument=defaultNamedNotOptArg): print 'OnNew Occurs when a new drawing has been created.' def OnBeginOpen(self, DrawingName=defaultNamedNotOptArg): print 'OnBeginOpen Occurs when a drawing is requested to be opened' def OnEndSave(self, FileName=defaultNamedNotOptArg): print 'OnEndSave Occurs when a request to save the drawing has been completed' def OnEndCommand(self, CommandName=defaultNamedNotOptArg): print 'OnEndCommand Occurs when a command is completed' def OnEndPlot(self, DrawingName=defaultNamedNotOptArg): print 'OnEndPlot Occurs when drawing has been sent to the printer' def OnSave(self, Document=defaultNamedNotOptArg): print 'OnSave Occurs when a drawing is about to be saved.' def OnBeginLisp(self, FirstLine=defaultNamedNotOptArg): print 'OnBeginLisp Occurs when receives a request to evaluate a LISP expression' def OnEndOpen(self, DrawingName=defaultNamedNotOptArg): print 'OnEndOpen Occurs after a drawing has been opened' def OnBeginQuit(self, Cancel=pythoncom.Missing): print 'OnBeginQuit Occurs when the application starts to shut down. Returning False will terminate the shutdown.' def OnReinitialize(self): print 'OnReinitialize Occurs each time you open or create a drawing' def OnAppDeactivate(self): print 'OnAppDeactivate Occurs when the application window is deactivated' def OnBeginSave(self, FileName=defaultNamedNotOptArg): print 'OnBeginSave Occurs when receives a request to save the drawing' def OnBeforeExit(self, Cancel=pythoncom.Missing): print 'OnBeforeExit Occurs when the application starts to shut down. Returning False will terminate the shutdown.' def OnEndLisp(self): print 'OnEndLisp Occurs when evaluation of a LISP expression is completed' def OnWindowChanged(self, vicWindowState=defaultNamedNotOptArg): print 'OnWindowChanged Occurs when window state is changed' def OnBeginPlot(self, DrawingName=defaultNamedNotOptArg): print 'OnBeginPlot Occurs when receives a request to print drawing' def OnAppActivate(self): print 'OnAppActivate Occurs when the application window is activated' def OnStartup(self): print 'OnStartup Occurs when the application is starting up.' # def OnSysVarChanged(self, SysVarName=defaultNamedNotOptArg, NewVal=defaultNamedNotOptArg): # print 'Occurs when the value of a system variable is changed' def OnBeginModal(self): print 'OnBeginModal Occurs when a modal dialog is about to be displayed' def OnWindowMovedOrResized(self, HWNDFrame=defaultNamedNotOptArg, bMoved=defaultNamedNotOptArg): print 'OnWindowMovedOrResized Occurs when window is moved or resized' def OnClose(self, Document=defaultNamedNotOptArg): print 'OnClose Occurs when a drawing is about to be closed.' def OnBeginCommand(self, CommandName=defaultNamedNotOptArg): print 'OnBeginCommand Occurs when a command is called' def OnOpen(self, Document=defaultNamedNotOptArg): print 'OnOpen Occurs after a drawing has been opened.' class DocumentEvents(IntelliCAD._EIcadDocument): def __init__(self,oobj=None): IntelliCAD._EIcadDocument.__init__(self, oobj) # If you create handlers, they should have the following prototypes: def OnDeactivate(self): print 'OnDeactivate Occurs when a document window is deactivated' def OnBeginDocClose(self, Cancel=pythoncom.Missing): print 'OnBeginDocClose Occurs when IntelliCAD receives a request to close the drawing' def OnBeginPlot(self, DrawingName=defaultNamedNotOptArg): print 'OnBeginPlot Occurs when receives a request to print drawing' def OnBeginClose(self): print 'OnBeginClose Occurs when IntelliCAD receives a request to close the drawing' def OnEndCommand(self, CommandName=defaultNamedNotOptArg): print 'OnEndCommand Occurs when a command completed' def OnEndPlot(self, DrawingName=defaultNamedNotOptArg): print 'OnEndPlot Occurs when drawing has been sent to the printer' def OnSave(self): print 'OnSave Occurs when a drawing is about to be saved.' def OnBeginLisp(self, FirstLine=defaultNamedNotOptArg): print 'OnBeginLisp Occurs when receives a request to evaluate a LISP expression' def OnSelectionChanged(self): print 'OnSelectionChanged Occurs when the current selection set is changed' def OnLayoutSwitched(self, LayoutName=defaultNamedNotOptArg): print 'OnLayoutSwitched Occurs after switching to a different layout' def OnBeginSave(self, FileName=defaultNamedNotOptArg): print 'OnBeginSave Occurs when receives a request to save the drawing' def OnEndLisp(self): print 'OnEndLisp Occurs when evaluating of a LISP expression completed' def OnBeginDoubleClick(self, PickPoint=defaultNamedNotOptArg): print 'OnBeginDoubleClick Occurs when the user double-clicks on the drawing window' def OnWindowChanged(self, vicWindowState=defaultNamedNotOptArg): print 'OnWindowChanged Occurs when window state changed' def OnBeginRightClick(self, PickPoint=defaultNamedNotOptArg): print 'OnBeginRightClick Occurs when the user right-clicks on the drawing window' def OnLispCanceled(self): print 'OnLispCanceled Occurs when evaluating of a LISP expression canceled' def OnActivate(self): print 'OnActivate Occurs when a document window is activated' def OnEndSave(self, FileName=defaultNamedNotOptArg): print 'OnEndSave Occurs when a request to save the drawing has been completed' def OnWindowMovedOrResized(self, HWNDFrame=defaultNamedNotOptArg, bMoved=defaultNamedNotOptArg): print 'OnWindowMovedOrResized Occurs when window moved or resized' def OnClose(self,cancel=pythoncom.Missing): print 'OnClose Occurs when a drawing is about to be closed.' def OnBeginCommand(self, CommandName=defaultNamedNotOptArg): print 'OnBeginCommand Occurs when receives a command' def OnOpen(self): print 'OnOpen Occurs after a drawing has been opened.' icad = win32com.client.Dispatch(icad_ProgID,'Administrator') app = icad.Application ws = icad.Workspace ad = icad.ActiveDocument ws_ev = win32com.client.WithEvents(app,WorkspaceEvents) doc_ev = win32com.client.WithEvents(ad,DocumentEvents) #pythoncom.PumpMessages() import Tkinter root = Tkinter.Tk() root.mainloop() Some workspace events are catched (like OnAppActivate and OnAppDeactivate) or for document events (OnActivate, OnDeactivate) but most are not. For instance opening drawings or adding new ones is ignored. If however I call the method for creating new documents or opening existing the events work. So the hint might be it has something to do with the focus. In VB2010 everything works as exspected so I think the program is ok. Neither root.mainloop() nor pythoncom.PumpMessages() work. I also tried a different implementation of the events: icad = IntelliCAD.Application() WSClass = ClassType("COMEventClass", (icad.__class__, icad.default_source, WorkspaceEvents), {'__setattr__': win32com.client._event_setattr_}) wse = WSClass(icad._oleobj_) icad.default_source.__init__(wse,wse) icad = win32com.client.EventsProxy(wse) ...but the behavior is just the same. Could threading be a solution to my problem? I've never done threading before and I am relativly new to python so if anyone could give me a starting hand for threading I'll be glad. Any other suggestions are also welcome. Thank you for your audience. Kind regards Johannes Frank -- Dipl.-Ing. (FH) Johannes-Maria Frank Bildungsberater K?nigsberger-Str. 19b 76139 Karlsruhe Tel. +49(170) 3833849 e-mail: jmfrank63 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmfrank63 at gmail.com Thu Feb 7 17:03:57 2013 From: jmfrank63 at gmail.com (Johannes Frank) Date: Thu, 7 Feb 2013 17:03:57 +0100 Subject: [python-win32] pythonwin not catching all events In-Reply-To: References: Message-ID: Hello Newsgroup, I dug into this further and got it running in a thread. No change with the events, same behavior. I added to the working Appdeactivate event an vba routine to add a new drawing. Thus I had the focus when the event occurs and now I got the event. Naturally this is not desirable since the user has the focus when he adds a new drawing, but I want my program to get notified of this. I installed python 3.3 and it didn't work at all for events. Here is my code: import win32com.client from pythoncom import com_error from pythoncom import Missing import pythoncom progid = 'Excel.Application' xl = win32com.client.Dispatch(progid) WEC = win32com.client.getevents(progid) class WE(WEC): def OnRelease(self): print ('OnExit Occurs when the application is about to exit.') xl.Visible = True xle = win32com.client.WithEvents(xl,WE) The last line fails with: result_class = new_type("COMEventClass", (events_class, user_event_class), {}) TypeError: Cannot create a consistent method resolution order (MRO) for bases AppEvents, WE Intellicad also fails with the same error. I am using XP 32bit. Anyone with a suggestion? I am free to use either python2 or python 3 as long as I do get all events. Thank you for your audience. Kind regards Johannes Frank 2013/2/6 Johannes Frank > Hello Newsgroup, > > I am currently programming ProgeCAD an AutoCAD Clone and having > difficulties catching all events. > > My code: > > import win32com.client > import pythoncom,pywintypes > import time > import tkFileDialog > import tkSimpleDialog > import IntelliCAD > import sys > > icad_CLSID = '{77E49E57-976B-11CF-8CCB-00A0245B09EB}' > icad_ProgID = 'Icad.Application' > icad_mod = win32com.client.gencache.EnsureModule(icad_CLSID, 0,1,0) > > defaultNamedOptArg=pythoncom.Empty > defaultNamedNotOptArg=pythoncom.Empty > defaultUnnamedArg=pythoncom.Empty > > class WorkspaceEvents(IntelliCAD._IcadWorkspaceEvents): > def __init__(self, oobj=None): > IntelliCAD._IcadWorkspaceEvents.__init__(self, oobj) > > # If you create handlers, they should have the following prototypes: > def OnBeginFileDrop(self, FileName=defaultNamedNotOptArg, > Cancel=pythoncom.Missing): > print 'OnBeginFileDrop Occurs when a file is dropped on the > application window' > def OnNewDrawing(self): > print 'OnNewDrawing Occurs when a new drawing is about to be > created' > def OnAddinRun(self, AddinFunctionName=defaultNamedNotOptArg): > print 'OnAddinRun Occurs when the user runs an add-in function > from the command line' > def OnEndModal(self): > print 'OnEndModal Occurs when a modal dialog is closed' > def OnExit(self): > print 'OnExit Occurs when the application is about to exit.' > def OnLispCancelled(self): > print 'OnLispCancelled Occurs when evaluation of a LISP expression > is cancelled' > def OnNew(self, NewDocument=defaultNamedNotOptArg): > print 'OnNew Occurs when a new drawing has been created.' > def OnBeginOpen(self, DrawingName=defaultNamedNotOptArg): > print 'OnBeginOpen Occurs when a drawing is requested to be opened' > def OnEndSave(self, FileName=defaultNamedNotOptArg): > print 'OnEndSave Occurs when a request to save the drawing has > been completed' > def OnEndCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnEndCommand Occurs when a command is completed' > def OnEndPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnEndPlot Occurs when drawing has been sent to the printer' > def OnSave(self, Document=defaultNamedNotOptArg): > print 'OnSave Occurs when a drawing is about to be saved.' > def OnBeginLisp(self, FirstLine=defaultNamedNotOptArg): > print 'OnBeginLisp Occurs when receives a request to evaluate a > LISP expression' > def OnEndOpen(self, DrawingName=defaultNamedNotOptArg): > print 'OnEndOpen Occurs after a drawing has been opened' > def OnBeginQuit(self, Cancel=pythoncom.Missing): > print 'OnBeginQuit Occurs when the application starts to shut > down. Returning False will terminate the shutdown.' > def OnReinitialize(self): > print 'OnReinitialize Occurs each time you open or create a > drawing' > def OnAppDeactivate(self): > print 'OnAppDeactivate Occurs when the application window is > deactivated' > def OnBeginSave(self, FileName=defaultNamedNotOptArg): > print 'OnBeginSave Occurs when receives a request to save the > drawing' > def OnBeforeExit(self, Cancel=pythoncom.Missing): > print 'OnBeforeExit Occurs when the application starts to shut > down. Returning False will terminate the shutdown.' > def OnEndLisp(self): > print 'OnEndLisp Occurs when evaluation of a LISP expression is > completed' > def OnWindowChanged(self, vicWindowState=defaultNamedNotOptArg): > print 'OnWindowChanged Occurs when window state is changed' > def OnBeginPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnBeginPlot Occurs when receives a request to print drawing' > def OnAppActivate(self): > print 'OnAppActivate Occurs when the application window is > activated' > def OnStartup(self): > print 'OnStartup Occurs when the application is starting up.' > # def OnSysVarChanged(self, SysVarName=defaultNamedNotOptArg, > NewVal=defaultNamedNotOptArg): > # print 'Occurs when the value of a system variable is changed' > def OnBeginModal(self): > print 'OnBeginModal Occurs when a modal dialog is about to be > displayed' > def OnWindowMovedOrResized(self, HWNDFrame=defaultNamedNotOptArg, > bMoved=defaultNamedNotOptArg): > print 'OnWindowMovedOrResized Occurs when window is moved or > resized' > def OnClose(self, Document=defaultNamedNotOptArg): > print 'OnClose Occurs when a drawing is about to be closed.' > def OnBeginCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnBeginCommand Occurs when a command is called' > def OnOpen(self, Document=defaultNamedNotOptArg): > print 'OnOpen Occurs after a drawing has been opened.' > > > class DocumentEvents(IntelliCAD._EIcadDocument): > def __init__(self,oobj=None): > IntelliCAD._EIcadDocument.__init__(self, oobj) > > # If you create handlers, they should have the following prototypes: > > def OnDeactivate(self): > print 'OnDeactivate Occurs when a document window is deactivated' > def OnBeginDocClose(self, Cancel=pythoncom.Missing): > print 'OnBeginDocClose Occurs when IntelliCAD receives a request > to close the drawing' > def OnBeginPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnBeginPlot Occurs when receives a request to print drawing' > def OnBeginClose(self): > print 'OnBeginClose Occurs when IntelliCAD receives a request to > close the drawing' > def OnEndCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnEndCommand Occurs when a command completed' > def OnEndPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnEndPlot Occurs when drawing has been sent to the printer' > def OnSave(self): > print 'OnSave Occurs when a drawing is about to be saved.' > def OnBeginLisp(self, FirstLine=defaultNamedNotOptArg): > print 'OnBeginLisp Occurs when receives a request to evaluate a > LISP expression' > def OnSelectionChanged(self): > print 'OnSelectionChanged Occurs when the current selection set is > changed' > def OnLayoutSwitched(self, LayoutName=defaultNamedNotOptArg): > print 'OnLayoutSwitched Occurs after switching to a different > layout' > def OnBeginSave(self, FileName=defaultNamedNotOptArg): > print 'OnBeginSave Occurs when receives a request to save the > drawing' > def OnEndLisp(self): > print 'OnEndLisp Occurs when evaluating of a LISP expression > completed' > def OnBeginDoubleClick(self, PickPoint=defaultNamedNotOptArg): > print 'OnBeginDoubleClick Occurs when the user double-clicks on > the drawing window' > def OnWindowChanged(self, vicWindowState=defaultNamedNotOptArg): > print 'OnWindowChanged Occurs when window state changed' > def OnBeginRightClick(self, PickPoint=defaultNamedNotOptArg): > print 'OnBeginRightClick Occurs when the user right-clicks on the > drawing window' > def OnLispCanceled(self): > print 'OnLispCanceled Occurs when evaluating of a LISP expression > canceled' > def OnActivate(self): > print 'OnActivate Occurs when a document window is activated' > def OnEndSave(self, FileName=defaultNamedNotOptArg): > print 'OnEndSave Occurs when a request to save the drawing has > been completed' > def OnWindowMovedOrResized(self, HWNDFrame=defaultNamedNotOptArg, > bMoved=defaultNamedNotOptArg): > print 'OnWindowMovedOrResized Occurs when window moved or resized' > def OnClose(self,cancel=pythoncom.Missing): > print 'OnClose Occurs when a drawing is about to be closed.' > def OnBeginCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnBeginCommand Occurs when receives a command' > def OnOpen(self): > print 'OnOpen Occurs after a drawing has been opened.' > > icad = win32com.client.Dispatch(icad_ProgID,'Administrator') > app = icad.Application > ws = icad.Workspace > ad = icad.ActiveDocument > ws_ev = win32com.client.WithEvents(app,WorkspaceEvents) > doc_ev = win32com.client.WithEvents(ad,DocumentEvents) > > #pythoncom.PumpMessages() > > import Tkinter > root = Tkinter.Tk() > root.mainloop() > > Some workspace events are catched (like OnAppActivate and OnAppDeactivate) > or for document events (OnActivate, OnDeactivate) but most are not. > For instance opening drawings or adding new ones is ignored. If however I > call the method for creating new documents or opening existing the events > work. So the hint might be it has something to do with the focus. > In VB2010 everything works as exspected so I think the program is ok. > > Neither root.mainloop() nor pythoncom.PumpMessages() work. I also tried a > different implementation of the events: > > icad = IntelliCAD.Application() > WSClass = ClassType("COMEventClass", (icad.__class__, icad.default_source, > WorkspaceEvents), {'__setattr__': win32com.client._event_setattr_}) > wse = WSClass(icad._oleobj_) > icad.default_source.__init__(wse,wse) > icad = win32com.client.EventsProxy(wse) > > ...but the behavior is just the same. > > Could threading be a solution to my problem? I've never done threading > before and I am relativly new to python so if anyone could give me a > starting hand for threading I'll be glad. > > Any other suggestions are also welcome. > > Thank you for your audience. > > Kind regards > > Johannes Frank > > > > > > > > -- > Dipl.-Ing. (FH) Johannes-Maria Frank > Bildungsberater > K?nigsberger-Str. 19b > 76139 Karlsruhe > Tel. +49(170) 3833849 > e-mail: jmfrank63 at gmail.com > -- Dipl.-Ing. (FH) Johannes-Maria Frank Bildungsberater K?nigsberger-Str. 19b 76139 Karlsruhe Tel. +49(170) 3833849 e-mail: jmfrank63 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmfrank63 at gmail.com Thu Feb 7 17:54:31 2013 From: jmfrank63 at gmail.com (Johannes Frank) Date: Thu, 7 Feb 2013 17:54:31 +0100 Subject: [python-win32] pythonwin not catching all events In-Reply-To: References: Message-ID: Hello, now I got it working with python33. In win32com.client in function WithEvents I exchanged event_class with user_event_class: result_class = new_type("COMEventClass", (user_event_class, events_class), {}) Same has to be done with the DispatchWithEvent function. If someone gives me a hand on how to supply a patch I'll be glad do this. Now it runs, but the behaviour didn't change: No events without focus. I am starting to run out of ideas. :-( Kind regards Johannes Frank 2013/2/6 Johannes Frank > Hello Newsgroup, > > I am currently programming ProgeCAD an AutoCAD Clone and having > difficulties catching all events. > > My code: > > import win32com.client > import pythoncom,pywintypes > import time > import tkFileDialog > import tkSimpleDialog > import IntelliCAD > import sys > > icad_CLSID = '{77E49E57-976B-11CF-8CCB-00A0245B09EB}' > icad_ProgID = 'Icad.Application' > icad_mod = win32com.client.gencache.EnsureModule(icad_CLSID, 0,1,0) > > defaultNamedOptArg=pythoncom.Empty > defaultNamedNotOptArg=pythoncom.Empty > defaultUnnamedArg=pythoncom.Empty > > class WorkspaceEvents(IntelliCAD._IcadWorkspaceEvents): > def __init__(self, oobj=None): > IntelliCAD._IcadWorkspaceEvents.__init__(self, oobj) > > # If you create handlers, they should have the following prototypes: > def OnBeginFileDrop(self, FileName=defaultNamedNotOptArg, > Cancel=pythoncom.Missing): > print 'OnBeginFileDrop Occurs when a file is dropped on the > application window' > def OnNewDrawing(self): > print 'OnNewDrawing Occurs when a new drawing is about to be > created' > def OnAddinRun(self, AddinFunctionName=defaultNamedNotOptArg): > print 'OnAddinRun Occurs when the user runs an add-in function > from the command line' > def OnEndModal(self): > print 'OnEndModal Occurs when a modal dialog is closed' > def OnExit(self): > print 'OnExit Occurs when the application is about to exit.' > def OnLispCancelled(self): > print 'OnLispCancelled Occurs when evaluation of a LISP expression > is cancelled' > def OnNew(self, NewDocument=defaultNamedNotOptArg): > print 'OnNew Occurs when a new drawing has been created.' > def OnBeginOpen(self, DrawingName=defaultNamedNotOptArg): > print 'OnBeginOpen Occurs when a drawing is requested to be opened' > def OnEndSave(self, FileName=defaultNamedNotOptArg): > print 'OnEndSave Occurs when a request to save the drawing has > been completed' > def OnEndCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnEndCommand Occurs when a command is completed' > def OnEndPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnEndPlot Occurs when drawing has been sent to the printer' > def OnSave(self, Document=defaultNamedNotOptArg): > print 'OnSave Occurs when a drawing is about to be saved.' > def OnBeginLisp(self, FirstLine=defaultNamedNotOptArg): > print 'OnBeginLisp Occurs when receives a request to evaluate a > LISP expression' > def OnEndOpen(self, DrawingName=defaultNamedNotOptArg): > print 'OnEndOpen Occurs after a drawing has been opened' > def OnBeginQuit(self, Cancel=pythoncom.Missing): > print 'OnBeginQuit Occurs when the application starts to shut > down. Returning False will terminate the shutdown.' > def OnReinitialize(self): > print 'OnReinitialize Occurs each time you open or create a > drawing' > def OnAppDeactivate(self): > print 'OnAppDeactivate Occurs when the application window is > deactivated' > def OnBeginSave(self, FileName=defaultNamedNotOptArg): > print 'OnBeginSave Occurs when receives a request to save the > drawing' > def OnBeforeExit(self, Cancel=pythoncom.Missing): > print 'OnBeforeExit Occurs when the application starts to shut > down. Returning False will terminate the shutdown.' > def OnEndLisp(self): > print 'OnEndLisp Occurs when evaluation of a LISP expression is > completed' > def OnWindowChanged(self, vicWindowState=defaultNamedNotOptArg): > print 'OnWindowChanged Occurs when window state is changed' > def OnBeginPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnBeginPlot Occurs when receives a request to print drawing' > def OnAppActivate(self): > print 'OnAppActivate Occurs when the application window is > activated' > def OnStartup(self): > print 'OnStartup Occurs when the application is starting up.' > # def OnSysVarChanged(self, SysVarName=defaultNamedNotOptArg, > NewVal=defaultNamedNotOptArg): > # print 'Occurs when the value of a system variable is changed' > def OnBeginModal(self): > print 'OnBeginModal Occurs when a modal dialog is about to be > displayed' > def OnWindowMovedOrResized(self, HWNDFrame=defaultNamedNotOptArg, > bMoved=defaultNamedNotOptArg): > print 'OnWindowMovedOrResized Occurs when window is moved or > resized' > def OnClose(self, Document=defaultNamedNotOptArg): > print 'OnClose Occurs when a drawing is about to be closed.' > def OnBeginCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnBeginCommand Occurs when a command is called' > def OnOpen(self, Document=defaultNamedNotOptArg): > print 'OnOpen Occurs after a drawing has been opened.' > > > class DocumentEvents(IntelliCAD._EIcadDocument): > def __init__(self,oobj=None): > IntelliCAD._EIcadDocument.__init__(self, oobj) > > # If you create handlers, they should have the following prototypes: > > def OnDeactivate(self): > print 'OnDeactivate Occurs when a document window is deactivated' > def OnBeginDocClose(self, Cancel=pythoncom.Missing): > print 'OnBeginDocClose Occurs when IntelliCAD receives a request > to close the drawing' > def OnBeginPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnBeginPlot Occurs when receives a request to print drawing' > def OnBeginClose(self): > print 'OnBeginClose Occurs when IntelliCAD receives a request to > close the drawing' > def OnEndCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnEndCommand Occurs when a command completed' > def OnEndPlot(self, DrawingName=defaultNamedNotOptArg): > print 'OnEndPlot Occurs when drawing has been sent to the printer' > def OnSave(self): > print 'OnSave Occurs when a drawing is about to be saved.' > def OnBeginLisp(self, FirstLine=defaultNamedNotOptArg): > print 'OnBeginLisp Occurs when receives a request to evaluate a > LISP expression' > def OnSelectionChanged(self): > print 'OnSelectionChanged Occurs when the current selection set is > changed' > def OnLayoutSwitched(self, LayoutName=defaultNamedNotOptArg): > print 'OnLayoutSwitched Occurs after switching to a different > layout' > def OnBeginSave(self, FileName=defaultNamedNotOptArg): > print 'OnBeginSave Occurs when receives a request to save the > drawing' > def OnEndLisp(self): > print 'OnEndLisp Occurs when evaluating of a LISP expression > completed' > def OnBeginDoubleClick(self, PickPoint=defaultNamedNotOptArg): > print 'OnBeginDoubleClick Occurs when the user double-clicks on > the drawing window' > def OnWindowChanged(self, vicWindowState=defaultNamedNotOptArg): > print 'OnWindowChanged Occurs when window state changed' > def OnBeginRightClick(self, PickPoint=defaultNamedNotOptArg): > print 'OnBeginRightClick Occurs when the user right-clicks on the > drawing window' > def OnLispCanceled(self): > print 'OnLispCanceled Occurs when evaluating of a LISP expression > canceled' > def OnActivate(self): > print 'OnActivate Occurs when a document window is activated' > def OnEndSave(self, FileName=defaultNamedNotOptArg): > print 'OnEndSave Occurs when a request to save the drawing has > been completed' > def OnWindowMovedOrResized(self, HWNDFrame=defaultNamedNotOptArg, > bMoved=defaultNamedNotOptArg): > print 'OnWindowMovedOrResized Occurs when window moved or resized' > def OnClose(self,cancel=pythoncom.Missing): > print 'OnClose Occurs when a drawing is about to be closed.' > def OnBeginCommand(self, CommandName=defaultNamedNotOptArg): > print 'OnBeginCommand Occurs when receives a command' > def OnOpen(self): > print 'OnOpen Occurs after a drawing has been opened.' > > icad = win32com.client.Dispatch(icad_ProgID,'Administrator') > app = icad.Application > ws = icad.Workspace > ad = icad.ActiveDocument > ws_ev = win32com.client.WithEvents(app,WorkspaceEvents) > doc_ev = win32com.client.WithEvents(ad,DocumentEvents) > > #pythoncom.PumpMessages() > > import Tkinter > root = Tkinter.Tk() > root.mainloop() > > Some workspace events are catched (like OnAppActivate and OnAppDeactivate) > or for document events (OnActivate, OnDeactivate) but most are not. > For instance opening drawings or adding new ones is ignored. If however I > call the method for creating new documents or opening existing the events > work. So the hint might be it has something to do with the focus. > In VB2010 everything works as exspected so I think the program is ok. > > Neither root.mainloop() nor pythoncom.PumpMessages() work. I also tried a > different implementation of the events: > > icad = IntelliCAD.Application() > WSClass = ClassType("COMEventClass", (icad.__class__, icad.default_source, > WorkspaceEvents), {'__setattr__': win32com.client._event_setattr_}) > wse = WSClass(icad._oleobj_) > icad.default_source.__init__(wse,wse) > icad = win32com.client.EventsProxy(wse) > > ...but the behavior is just the same. > > Could threading be a solution to my problem? I've never done threading > before and I am relativly new to python so if anyone could give me a > starting hand for threading I'll be glad. > > Any other suggestions are also welcome. > > Thank you for your audience. > > Kind regards > > Johannes Frank > > > > > > > > -- > Dipl.-Ing. (FH) Johannes-Maria Frank > Bildungsberater > K?nigsberger-Str. 19b > 76139 Karlsruhe > Tel. +49(170) 3833849 > e-mail: jmfrank63 at gmail.com > -- Dipl.-Ing. (FH) Johannes-Maria Frank Bildungsberater K?nigsberger-Str. 19b 76139 Karlsruhe Tel. +49(170) 3833849 e-mail: jmfrank63 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Leonard.Berman at surecomp.com Thu Feb 7 22:50:05 2013 From: Leonard.Berman at surecomp.com (Leonard.Berman at surecomp.com) Date: Thu, 7 Feb 2013 21:50:05 +0000 Subject: [python-win32] Error starting Windows services using PYMQI Message-ID: Hi, We are Python novices but have some Windows services written in Python 2.4.3 by somebody no longer at our company. These services use MQ-Series. We are trying to install and run these services on another machine on which Python was previously not installed. We successfully installed the services but when we try to start them we receive the following errors in the Windows event viewer. Python could not import the service's module File "C:\Documents and Settings\BinaJ\Desktop\ibswin\exe\COMMON\Scripts\interfaceServices.py", line 184, in ? import pymqi File "C:\Documents and Settings\BinaJ\Desktop\ibswin\exe\COMMON\lib\pymqi.py", line 82, in ? import pymqe, CMQC, CMQCFC exceptions.ImportError: DLL load failed: The specified module could not be found. - We have the files, pymqi.pyc and pymqe.pyd. We have specified the path containing the files in PYTHONPATH. - We successfully ran "python setup.py install" in the PYMQI directory - We could not run "python setup.py build client" as we do not have Visual Studio 7.1 Questions: - Should we have a file pymqi.pyd? - Do we need to build the client? - What suggestions do you have to fix our problem? Thank you. Leonard Berman This mail was sent via Mail-SeCure System. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amauryfa at gmail.com Thu Feb 7 23:09:57 2013 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Thu, 7 Feb 2013 23:09:57 +0100 Subject: [python-win32] Error starting Windows services using PYMQI In-Reply-To: References: Message-ID: Hi, 2013/2/7 > Python could not import the service's module **** > > File "C:\Documents and > Settings\BinaJ\Desktop\ibswin\exe\COMMON\Scripts\interfaceServices.py", > line 184, in ?**** > > import pymqi**** > > File "C:\Documents and > Settings\BinaJ\Desktop\ibswin\exe\COMMON\lib\pymqi.py", line 82, in ?**** > > import pymqe, CMQC, CMQCFC **** > > exceptions.ImportError: DLL load failed: The specified module could not be > found. > It's not a python file that is missing, but a DLL required by pymqe.pyd. I guess that it's a MQ Series Client DLL... You should ensure that MQ Series Client libraries are installed, and available in the PATH environment variable. Oh, and since this is a service: this PATH should be set at the machine level, not at the logged-in user level. -- Amaury Forgeot d'Arc -------------- next part -------------- An HTML attachment was scrubbed... URL: From WeikEngOff at aol.com Sun Feb 10 17:07:09 2013 From: WeikEngOff at aol.com (Udo Weik) Date: Sun, 10 Feb 2013 17:07:09 +0100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger Message-ID: <5117C5AD.9030406@aol.com> Hello, I want to use the standard Python 2.6 distribution from www.python.org as a Windows Scripting Host (WSH) scripting language. Is there any way to get debugging working with the WSH? Many thanks and greetings Udo From skippy.hammond at gmail.com Sun Feb 10 23:15:32 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 11 Feb 2013 09:15:32 +1100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <5117C5AD.9030406@aol.com> References: <5117C5AD.9030406@aol.com> Message-ID: <51181C04.8090904@gmail.com> Debugging should work "out of the box" - what problems are you seeing? Mark On 11/02/2013 3:07 AM, Udo Weik wrote: > Hello, > > I want to use the standard Python 2.6 distribution from > www.python.org as a Windows Scripting Host (WSH) scripting > language. Is there any way to get debugging working with the > WSH? > > > Many thanks and greetings > Udo > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From jonatan.magnusson at gmail.com Tue Feb 12 15:02:15 2013 From: jonatan.magnusson at gmail.com (Jonatan Magnusson) Date: Tue, 12 Feb 2013 15:02:15 +0100 Subject: [python-win32] Building 3.3.0 as static library Message-ID: Hi I recently posted this to python-list but I got no responses so I'm trying here instead: I'm trying to build Python 3.3.0 on Windows using Visual Studio 2010 Express. I opened the solution (pcbuild.sln) and built the "python" project (including its dependencies of course) and that worked fine with just a few warnings. But I need to build Python using the the static C runtime so I followed the instructions (readme.txt): * Changed "Runtime Library" to non-DLL variant (/MT or /MTd) for each of the projects (make_buildinfo, make_versioninfo, kill_python, python core, w9xpopen and python) * Changed preprocessor macro Py_ENABLED_SHARED to Py_NO_ENABLE_SHARED in the pythoncore project * Changed configuration type from Dynamic Library to Static library for the pythoncore project Then I recompiled and once again it built with just a few warnings, until the link stage where "__imp__Py_Main" was unresolved! Is it no longer supported to build against the static runtime libraries or am I doing something wrong? (I've also found that getbuildinfo.c is linked against the DLL runtime and I had to change the source code of make_buildinfo.c to change that.) Regards, Jonatan Magnusson From jonatan at cmteknik.se Tue Feb 12 15:01:00 2013 From: jonatan at cmteknik.se (Jonatan Magnusson) Date: Tue, 12 Feb 2013 15:01:00 +0100 Subject: [python-win32] Building 3.3.0 as static library Message-ID: Hi I recently posted this to python-list but I got no responses so I'm trying here instead: I'm trying to build Python 3.3.0 on Windows using Visual Studio 2010 Express. I opened the solution (pcbuild.sln) and built the "python" project (including its dependencies of course) and that worked fine with just a few warnings. But I need to build Python using the the static C runtime so I followed the instructions (readme.txt): * Changed "Runtime Library" to non-DLL variant (/MT or /MTd) for each of the projects (make_buildinfo, make_versioninfo, kill_python, python core, w9xpopen and python) * Changed preprocessor macro Py_ENABLED_SHARED to Py_NO_ENABLE_SHARED in the pythoncore project * Changed configuration type from Dynamic Library to Static library for the pythoncore project Then I recompiled and once again it built with just a few warnings, until the link stage where "__imp__Py_Main" was unresolved! Is it no longer supported to build against the static runtime libraries or am I doing something wrong? (I've also found that getbuildinfo.c is linked against the DLL runtime and I had to change the source code of make_buildinfo.c to change that.) Regards, Jonatan Magnusson From amauryfa at gmail.com Tue Feb 12 15:44:27 2013 From: amauryfa at gmail.com (Amaury Forgeot d'Arc) Date: Tue, 12 Feb 2013 15:44:27 +0100 Subject: [python-win32] Building 3.3.0 as static library In-Reply-To: References: Message-ID: 2013/2/12 Jonatan Magnusson > > Hi > > I recently posted this to python-list but I got no responses so I'm trying > here instead: > > I'm trying to build Python 3.3.0 on Windows using Visual Studio 2010 > Express. > > I opened the solution (pcbuild.sln) and built the "python" project > (including its dependencies of course) and that worked fine with just a few > warnings. > > But I need to build Python using the the static C runtime so I followed > the instructions (readme.txt): > > * Changed "Runtime Library" to non-DLL variant (/MT or /MTd) for each of > the projects (make_buildinfo, make_versioninfo, kill_python, python core, > w9xpopen and python) > * Changed preprocessor macro Py_ENABLED_SHARED to Py_NO_ENABLE_SHARED in > the pythoncore project > * Changed configuration type from Dynamic Library to Static library for > the pythoncore project > > Then I recompiled and once again it built with just a few warnings, until > the link stage where "__imp__Py_Main" was unresolved! > You should probably set Py_NO_ENABLE_SHARED in the main "python" project as well. > Is it no longer supported to build against the static runtime libraries or > am I doing something wrong? > Was it even supported at some point? See http://bugs.python.org/issue1327594 Don't forget to add all needed extension modules to your project. .pyd cannot work in a static library world. > (I've also found that getbuildinfo.c is linked against the DLL runtime and > I had to change the source code of make_buildinfo.c to change that.) > You can probably modify the "make_buildinfo" project instead. -- Amaury Forgeot d'Arc -------------- next part -------------- An HTML attachment was scrubbed... URL: From WeikEngOff at aol.com Tue Feb 12 17:17:29 2013 From: WeikEngOff at aol.com (Udo Weik) Date: Tue, 12 Feb 2013 17:17:29 +0100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <51181C04.8090904@gmail.com> References: <51181C04.8090904@gmail.com> Message-ID: <511A6B19.9040301@aol.com> Hello Mark, thanks for your answer. > Debugging should work "out of the box" - what problems are you seeing? I'm using a Delphi-component. That component checks whether the ActiveX debug interface is available (Windows Scripting Host, WSH). When I start my app, I get the following error message: Project XYZ.exe raised exception class EOleSysError with message 'Script engine does not support debugging.'. Many thanks and greetings Udo > On 11/02/2013 3:07 AM, Udo Weik wrote: >> Hello, >> >> I want to use the standard Python 2.6 distribution from >> www.python.org as a Windows Scripting Host (WSH) scripting >> language. Is there any way to get debugging working with the >> WSH? From jacob at blindza.co.za Wed Feb 13 07:36:35 2013 From: jacob at blindza.co.za (Jacob Kruger) Date: Wed, 13 Feb 2013 08:36:35 +0200 Subject: [python-win32] Python sound playback threading control? Message-ID: <4CCA5E4FBBDB4BE6BBD260936D6F4ED1@jakeslaptop> (back on this list now) Ok, this might be a slightly silly thought/idea/project, but, it's partly an experiment, to do with real time keystroke event handling/processing and sound playback triggering/interruption, etc., and it's sort of a starting point of something like a real-time, audio, platform game type app, done using python, and using things like sound_lib, keyboard_handler, accessible_output (those modules from http://hg.qwitter-client.net/), along with LBC (layout-by-code) module, etc. to currently handle keystrokes, and sound effect playback. However, what it comes down to is to wanting to make it possible to sort of bypass something like current sound playback, or interrupt it, and re-initiate the playback for the same object/sound file, etc. Anyway, if you'd like to have a look as such, and give me your thoughts/feedback, here's the source code thus far, in a zip file: https://dl.dropbox.com/u/13327195/platformGame.zip The two versions of the main code file are platformGame.py and platformGame-nonThreading.py. For what might also offer (minor) interest, am also making use of the class in the XmlDictObject.py file to convert XML data to and from a dictionary collection. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' -------------- next part -------------- An HTML attachment was scrubbed... URL: From newtechnologybooks at gmail.com Wed Feb 13 14:05:18 2013 From: newtechnologybooks at gmail.com (newtechnologybooks) Date: Wed, 13 Feb 2013 15:05:18 +0200 Subject: [python-win32] Failing to email large attachment with Python on Windows XP Message-ID: Hi, I'm struggling with sending a 100mb text file using Python running on a Windows XP client. I'm current running ActiveState Python 2.7.72 and it seems Python keeps failing with the following exception: Traceback (most recent call last): File "emailtest.py", line 32, in send_mail("test at example.com", [ "test at example.com" ], "Test", "TEST",[ r"C:\100mbfile.txt"] , "127.0.0.1") File "emailtest.py", line 28, in send_mail smtp.sendmail(send_from, send_to, message) File "C:\Python27\lib\smtplib.py", line 725, in sendmail (code, resp) = self.data(msg) File "C:\Python27\lib\smtplib.py", line 492, in data self.send(q) File "C:\Python27\lib\smtplib.py", line 317, in send raise SMTPServerDisconnected('Server not connected') In order to isolate the problem, I'm currently running a test SMTP server on the same host as the client using the following command: python -m smtpd -n -c DebuggingServer localhost:25 I'm using this script for building/delivering the email: def send_mail(send_from, send_to, subject, text, files=[], server="localhost"): msg = MIMEMultipart() msg['From'] = send_from msg['To'] = COMMASPACE.join(send_to) msg['Date'] = formatdate(localtime=True) msg['Subject'] = subject msg.attach( MIMEText(text) ) for f in files: part = MIMEBase('application', "octet-stream") part.set_payload( open(f,"rb").read() ) Encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment; filename="%s"' % os.path.basename(f)) msg.attach(part) message = msg.as_string() smtp = smtplib.SMTP(server) smtp.sendmail(send_from, send_to, message) smtp.close() send_mail("test at example.com", ["test at example.com"], "Test Subject", "Email Body", [ r"C:\100mbfile.txt"] , "localhost") I was able to deliver 20mb files with this script, but failed when trying 100mb files. It seems the code runs smoothly when I'm removing this line which encoded the part as base64: Encoders.encode_base64(part) I've notice the problem only occurs on my Windows XP, cause I was able to use the same code for delivering a 100mb file on a Windows 7 client. Using a sniffer I was able to ensure that the SMTP conversation is starting and get to the point where the client sends the "DATA" command, and then a few seconds later the client sends a "FIN" flagged packet to the server, which cause both ends to close the connection. Could you please advice what may cause this unexpected exception and how could it be fixed? -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Feb 13 18:48:42 2013 From: timr at probo.com (Tim Roberts) Date: Wed, 13 Feb 2013 09:48:42 -0800 Subject: [python-win32] Failing to email large attachment with Python on Windows XP In-Reply-To: References: Message-ID: <511BD1FA.7010700@probo.com> newtechnologybooks wrote: > > > I'm struggling with sending a 100mb text file using Python running on > a Windows XP client. > I do not doubt it. Most SMTP servers block attachments that large. > I was able to deliver 20mb files with this script, but failed when > trying 100mb files. That's further evidence that you have hit a server limit. If you want to send 100MB files, you store them on an FTP server or a web server and send a link. Companies do not want 100MB attachments clogging up their mail pipe and bulking up their mail store. > It seems the code runs smoothly when I'm removing this line which > encoded the part as base64: > > Encoders.encode_base64(part) > That increases the size of the attachment by another 33%. > > I've notice the problem only occurs on my Windows XP, cause I was able > to use the same code for delivering a 100mb file on a Windows 7 client. > To the EXACT SAME SERVER? Or were you testing a different server? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Wed Feb 13 20:51:45 2013 From: timr at probo.com (Tim Roberts) Date: Wed, 13 Feb 2013 11:51:45 -0800 Subject: [python-win32] Python sound playback threading control? In-Reply-To: <4CCA5E4FBBDB4BE6BBD260936D6F4ED1@jakeslaptop> References: <4CCA5E4FBBDB4BE6BBD260936D6F4ED1@jakeslaptop> Message-ID: <511BEED1.5050109@probo.com> Jacob Kruger wrote: > > However, what it comes down to is to wanting to make it possible to > sort of > bypass something like current sound playback, or interrupt it, and > re-initiate the playback for the same object/sound file, etc It depends on what APIs you're using to play the sound. Often, you're feeding the sound in buffer by buffer, so stopping the playback is just a matter of telling your own sound thread to stop sending buffers. If you're using some other higher-level API where you just deliver a WAV file, then you'll need to check out the facilities in that API. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From skippy.hammond at gmail.com Thu Feb 14 01:45:34 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Thu, 14 Feb 2013 11:45:34 +1100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511A6B19.9040301@aol.com> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> Message-ID: <511C33AE.2050605@gmail.com> On 13/02/2013 3:17 AM, Udo Weik wrote: > Hello Mark, > > thanks for your answer. > >> Debugging should work "out of the box" - what problems are you seeing? > > I'm using a Delphi-component. That component checks whether the > ActiveX debug interface is available (Windows Scripting Host, WSH). > When I start my app, I get the following error message: > > Project XYZ.exe raised exception class EOleSysError with message > 'Script engine does not support debugging.'. You could try registering the script engine with debugging support - change to the win32comext/axscript/client directory and execute "python pyscript.py --debug". Then, before loading the script engine, execute "python -m win32traceutil". In the win32traceutil window you should see some output generated - hopefully something there will point us in the right direction. Cheers, Mark > > > Many thanks and greetings > Udo > >> On 11/02/2013 3:07 AM, Udo Weik wrote: >>> Hello, >>> >>> I want to use the standard Python 2.6 distribution from >>> www.python.org as a Windows Scripting Host (WSH) scripting >>> language. Is there any way to get debugging working with the >>> WSH? > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From jacob at blindza.co.za Thu Feb 14 06:45:05 2013 From: jacob at blindza.co.za (Jacob Kruger) Date: Thu, 14 Feb 2013 07:45:05 +0200 Subject: [python-win32] Python sound playback threading control? References: <4CCA5E4FBBDB4BE6BBD260936D6F4ED1@jakeslaptop> <511BEED1.5050109@probo.com> Message-ID: <43036FC0F4394FB085CC1FA8A8595AD2@jakeslaptop> Well, it's currently making use of the sound_lib module - not sure which API it's using as such - but am using the stream object's play_blocking() method, which seems to be meant to interrupt other playbacks, but also played around with first using the stream's stop() method, before then trying to initiate .play(), or play_blocking(), and while they all seemed to work a little differently, none of those options seemed to really handle it quite like I would have hoped for/expected, in terms of just cutting sound playback off immediately, and then initiating a new playback, or something - suppose should also test this a bit on another machine to make sure it's not the machine am currently working with a form of performance lag, or something. Alternatively, any thoughts on something simple could try using that would offer something similar in terms of just, at least being able to manipulate playback pitch, at least 2D panning, pausing/stopping on demand, etc.? And, got hold of that sound_lib module from here: http://hg.qwitter-client.net/sound_lib TIA Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ----- Original Message ----- From: "Tim Roberts" To: "Python-Win32 List" Sent: Wednesday, February 13, 2013 9:51 PM Subject: Re: [python-win32] Python sound playback threading control? > Jacob Kruger wrote: >> >> However, what it comes down to is to wanting to make it possible to >> sort of >> bypass something like current sound playback, or interrupt it, and >> re-initiate the playback for the same object/sound file, etc > > It depends on what APIs you're using to play the sound. Often, you're > feeding the sound in buffer by buffer, so stopping the playback is just > a matter of telling your own sound thread to stop sending buffers. > > If you're using some other higher-level API where you just deliver a WAV > file, then you'll need to check out the facilities in that API. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From newtechnologybooks at gmail.com Thu Feb 14 07:37:42 2013 From: newtechnologybooks at gmail.com (newtechnologybooks) Date: Thu, 14 Feb 2013 08:37:42 +0200 Subject: [python-win32] Failing to email large attachment with Python on Windows XP Message-ID: [python-win32] Failing to email large attachment with Python on Windows XP*Tim Roberts* timr at probo.com *Wed Feb 13 18:48:42 CET 2013* - Previous message: [python-win32] Failing to email large attachment with Python on Windows XP - *Messages sorted by:* [ date ] [ thread ] [ subject ] [ author ] ------------------------------ newtechnologybooks wrote: >**>**>* I'm struggling with sending a 100mb text file using Python running on*>* a Windows XP client.*>** >> I do not doubt it. Most SMTP servers block attachments that large. Basically, I agree, but I'm using the Python SMTP server that does not limit the payload size. >* I was able to deliver 20mb files with this script, but failed when*>* trying 100mb files.* >> That's further evidence that you have hit a server limit. If you want >> to send 100MB files, you store them on an FTP server or a web server and >> send a link. Companies do not want 100MB attachments clogging up their >> mail pipe and bulking up their mail store. On my network sniffer I don't see any evidence that the code has start sending any kind of data to the sever, it just hang for a few seconds till the client send a FIN flagged packet to the server. I agree that it's is not a common use case for, but my code is used for testing a flow that works with our corporate clients (and the client does not experience any errors when sending such a large files). >* It seems the code runs smoothly when I'm removing this line which*>* encoded the part as base64:*>**>* Encoders.encode_base64(part)*>** >> That increases the size of the attachment by another 33%. That's true, but then again I do not have any limitation on the corporate server size, nor on the Python test server. >**>* I've notice the problem only occurs on my Windows XP, cause I was able*>* to use the same code for delivering a 100mb file on a Windows 7 client.*>** >> To the EXACT SAME SERVER? Or were you testing a different server? I've tried the same code with 3 different servers and got the same results of the client dropping the connection before trying to send a single byte of data. -------------- next part -------------- An HTML attachment was scrubbed... URL: From WeikEngOff at aol.com Thu Feb 14 10:32:07 2013 From: WeikEngOff at aol.com (Udo Weik) Date: Thu, 14 Feb 2013 10:32:07 +0100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511C33AE.2050605@gmail.com> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> <511C33AE.2050605@gmail.com> Message-ID: <511CAF17.7030008@aol.com> Hello again Mark, >> thanks for your answer. >> >>> Debugging should work "out of the box" - what problems are you seeing? >> >> I'm using a Delphi-component. That component checks whether the >> ActiveX debug interface is available (Windows Scripting Host, WSH). >> When I start my app, I get the following error message: >> >> Project XYZ.exe raised exception class EOleSysError with message >> 'Script engine does not support debugging.'. > > You could try registering the script engine with debugging support - change to the win32comext/axscript/client directory and execute "python pyscript.py --debug". Then, before loading the script > engine, execute "python -m win32traceutil". In the win32traceutil window you should see some output generated - hopefully something there will point us in the right direction. yep, many thanks for that hint. Tried it with the following result: ...\Python26\Lib\site-packages\win32comext\axscript\client>python pyscript.py --debug Registered: Python (for debugging) ...Python26\Lib\site-packages\win32comext\axscript\client>python -m win32traceutil Collecting Python Trace Output... Object with win32trace dispatcher created (object=None) in ._InvokeEx_-InitNew() [1,0,None] in ._InvokeEx_-SetScriptSite(,) [1,0,None] Debugging extensions (axdebug) module does not exist - debugging is disabled.. in ._QueryInterface_ with unsupported IID IActiveScriptDebug32 ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) in ._QueryInterface_ with unsupported IID IActiveScriptDebug32 ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) I'm a little bit confused - registering for debugging was possible, but the debug extensions aren't found. Just as a hint: I didn't use the standard installation pathes. Many thanks and greetings Udo >>> On 11/02/2013 3:07 AM, Udo Weik wrote: >>>> Hello, >>>> >>>> I want to use the standard Python 2.6 distribution from >>>> www.python.org as a Windows Scripting Host (WSH) scripting >>>> language. Is there any way to get debugging working with the >>>> WSH? >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 > From timr at probo.com Thu Feb 14 19:04:42 2013 From: timr at probo.com (Tim Roberts) Date: Thu, 14 Feb 2013 10:04:42 -0800 Subject: [python-win32] Python sound playback threading control? In-Reply-To: <43036FC0F4394FB085CC1FA8A8595AD2@jakeslaptop> References: <4CCA5E4FBBDB4BE6BBD260936D6F4ED1@jakeslaptop> <511BEED1.5050109@probo.com> <43036FC0F4394FB085CC1FA8A8595AD2@jakeslaptop> Message-ID: <511D273A.3040909@probo.com> Jacob Kruger wrote: > Well, it's currently making use of the sound_lib module - not sure which API > it's using as such - It's a wrapper around the "BASS" library, which is itself a wrapper around the lower-level APIs. The BASS library itself is an abstraction -- it lets you think in terms of whole files, rather than individual PCM packets. As a result, you give up a certain amount of low-level control. However, you should be able to "pause" and "stop" the streaming. > but am using the stream object's play_blocking() > method, which seems to be meant to interrupt other playbacks, Not at all! A blocking function means that it starts the playback, and then waits until the entire file is played, so that it cannot be interrupted. If you want to interrupt things, that's exactly the WRONG interface. You should be using "play". > Alternatively, any thoughts on something simple could try using that would > offer something similar in terms of just, at least being able to manipulate > playback pitch, at least 2D panning, pausing/stopping on demand, etc.? You've crossed a number of different domains there. You have certainly exited from the realm of "something simple". sound_lib will help you manage your streams (play, pause, stop, etc). Manipulating the pitch requires that you manipulate the sound files themselves. You will have to decode the files by hand, and run an algorithm on the decoded byte streams. 2D panning requires low-level access to the speaker configuration, which is yet another domain. You might start looking here to see if you can find the type of resources you need. http://wiki.python.org/moin/PythonInMusic -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Thu Feb 14 19:06:20 2013 From: timr at probo.com (Tim Roberts) Date: Thu, 14 Feb 2013 10:06:20 -0800 Subject: [python-win32] Failing to email large attachment with Python on Windows XP In-Reply-To: References: Message-ID: <511D279C.8070304@probo.com> newtechnologybooks wrote: > >/I was able to deliver 20mb files with this script, but failed when > />/trying 100mb files. / >> That's further evidence that you have hit > a server limit. If you want >> to send 100MB files, you store them on > an FTP server or a web server and >> send a link. Companies do not > want 100MB attachments clogging up their >> mail pipe and bulking up > their mail store. > On my network sniffer I don't see any evidence that the code has start sending any kind of data to the sever, it just hang for a few seconds till the client send a FIN flagged packet to the server. Is it possible that it's simply taking too long to read and/or encode the attachment? That seems like a long-shot, but you're kind of at the long-shot phase now. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From planders at gmail.com Thu Feb 14 19:09:25 2013 From: planders at gmail.com (Preston Landers) Date: Thu, 14 Feb 2013 12:09:25 -0600 Subject: [python-win32] Failing to email large attachment with Python on Windows XP In-Reply-To: <511D279C.8070304@probo.com> References: <511D279C.8070304@probo.com> Message-ID: On Thu, Feb 14, 2013 at 12:06 PM, Tim Roberts wrote: > newtechnologybooks wrote: >> >/I was able to deliver 20mb files with this script, but failed when >> />/trying 100mb files. / >> That's further evidence that you have hit >> a server limit. If you want >> to send 100MB files, you store them on >> an FTP server or a web server and >> send a link. Companies do not >> want 100MB attachments clogging up their >> mail pipe and bulking up >> their mail store. >> On my network sniffer I don't see any evidence that the code has start sending any kind of data to the sever, it just hang for a few seconds till the client send a FIN flagged packet to the server. > > Is it possible that it's simply taking too long to read and/or encode > the attachment? That seems like a long-shot, but you're kind of at the > long-shot phase now. I also wonder if he's got some kind of antivirus or security scanner intercepting things and getting hung up. I've seen it before. From jacob at blindza.co.za Thu Feb 14 19:59:09 2013 From: jacob at blindza.co.za (Jacob Kruger) Date: Thu, 14 Feb 2013 20:59:09 +0200 Subject: [python-win32] Python sound playback threading control? References: <4CCA5E4FBBDB4BE6BBD260936D6F4ED1@jakeslaptop><511BEED1.5050109@probo.com><43036FC0F4394FB085CC1FA8A8595AD2@jakeslaptop> <511D273A.3040909@probo.com> Message-ID: <3B9C538F547D46168FD78A930F699674@jakeslaptop> Ok, makes some sense, and now just experimented with the restart argument of the play_blocking() method, running it inside a loop for ten times, and, it then renders like 10 repeat playbacks one after the other quite quickly, whereas, yes, if just use play(), and then use stop() inbetween, you literally only hear sound being played like once, while it still returns the result of 1 for each time. Think must, for now just experiment with combinations of something like halting/pausing keystroke handling inbetween timeframe of sound playback, if using play_blocking(), or specifically make use of play(), but also keep track of/insert something like a thread pause for keyboard handling there as well. And, yes, already had bookmarked that page of the python wiki, but haven't gotten around to looking into it in too much detail as of yet... One of the other reasons am quite happy with sound_lib thus far is it offers 2D panning, as well as frequency manipulation, for implementing minor effects on sounds as well - for example, another simple example had is where took the sound of a motorbike running sort of flatly, and by playing it in a form of looping mode, when I then changed frequency in an incremental way, it sounded literally like speeding up, etc., as such. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ----- Original Message ----- From: "Tim Roberts" To: "Python-Win32 List" Sent: Thursday, February 14, 2013 8:04 PM Subject: Re: [python-win32] Python sound playback threading control? > Jacob Kruger wrote: >> Well, it's currently making use of the sound_lib module - not sure which >> API >> it's using as such - > > It's a wrapper around the "BASS" library, which is itself a wrapper > around the lower-level APIs. The BASS library itself is an abstraction > -- it lets you think in terms of whole files, rather than individual PCM > packets. As a result, you give up a certain amount of low-level control. > > However, you should be able to "pause" and "stop" the streaming. > > >> but am using the stream object's play_blocking() >> method, which seems to be meant to interrupt other playbacks, > > Not at all! A blocking function means that it starts the playback, and > then waits until the entire file is played, so that it cannot be > interrupted. If you want to interrupt things, that's exactly the WRONG > interface. You should be using "play". > > >> Alternatively, any thoughts on something simple could try using that >> would >> offer something similar in terms of just, at least being able to >> manipulate >> playback pitch, at least 2D panning, pausing/stopping on demand, etc.? > > You've crossed a number of different domains there. You have certainly > exited from the realm of "something simple". sound_lib will help you > manage your streams (play, pause, stop, etc). Manipulating the pitch > requires that you manipulate the sound files themselves. You will have > to decode the files by hand, and run an algorithm on the decoded byte > streams. 2D panning requires low-level access to the speaker > configuration, which is yet another domain. > > You might start looking here to see if you can find the type of > resources you need. > http://wiki.python.org/moin/PythonInMusic > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From mhammond at skippinet.com.au Thu Feb 14 23:23:20 2013 From: mhammond at skippinet.com.au (Mark Hammond) Date: Fri, 15 Feb 2013 09:23:20 +1100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511CAF17.7030008@aol.com> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> <511C33AE.2050605@gmail.com> <511CAF17.7030008@aol.com> Message-ID: <511D63D8.7020204@skippinet.com.au> Can you try: >>> import win32com.axscript.axscript >>> import win32com.axdebug.axdebug And see if that works? If so, maybe try and edit win32com\axscript\client\framework.py, find the error message you reported and print some details of the exception to try and determine why it can't find that module... Mark On 14/02/2013 8:32 PM, Udo Weik wrote: > Hello again Mark, > >>> thanks for your answer. >>> >>>> Debugging should work "out of the box" - what problems are you seeing? >>> >>> I'm using a Delphi-component. That component checks whether the >>> ActiveX debug interface is available (Windows Scripting Host, WSH). >>> When I start my app, I get the following error message: >>> >>> Project XYZ.exe raised exception class EOleSysError with message >>> 'Script engine does not support debugging.'. >> >> You could try registering the script engine with debugging support - >> change to the win32comext/axscript/client directory and execute >> "python pyscript.py --debug". Then, before loading the script >> engine, execute "python -m win32traceutil". In the win32traceutil >> window you should see some output generated - hopefully something >> there will point us in the right direction. > > yep, many thanks for that hint. Tried it with the following result: > > ...\Python26\Lib\site-packages\win32comext\axscript\client>python > pyscript.py --debug > Registered: Python (for debugging) > > > ...Python26\Lib\site-packages\win32comext\axscript\client>python -m > win32traceutil > > Collecting Python Trace Output... > Object with win32trace dispatcher created (object=None) > in 0x03436AA8>._InvokeEx_-InitNew() [1,0,None] > in 0x03436AA8>._InvokeEx_-SetScriptSite( with obj at 0x02159724>,) [1,0,None] > Debugging extensions (axdebug) module does not exist - debugging is > disabled.. > in 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 > ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) > in 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 > ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) > > I'm a little bit confused - registering for debugging was possible, but > the debug extensions aren't found. Just as a hint: I didn't use the > standard > installation pathes. > > > Many thanks and greetings > Udo > > >>>> On 11/02/2013 3:07 AM, Udo Weik wrote: >>>>> Hello, >>>>> >>>>> I want to use the standard Python 2.6 distribution from >>>>> www.python.org as a Windows Scripting Host (WSH) scripting >>>>> language. Is there any way to get debugging working with the >>>>> WSH? >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/mailman/listinfo/python-win32 >> > From WeikEngOff at aol.com Fri Feb 15 00:32:49 2013 From: WeikEngOff at aol.com (Udo Weik) Date: Fri, 15 Feb 2013 00:32:49 +0100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511D63D8.7020204@skippinet.com.au> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> <511C33AE.2050605@gmail.com> <511CAF17.7030008@aol.com> <511D63D8.7020204@skippinet.com.au> Message-ID: <511D7421.6030202@aol.com> Hello Mark, > >>> import win32com.axscript.axscript > >>> import win32com.axdebug. > > And see if that works? If so, maybe try and edit win32com\axscript\client\framework.py, find the error message you reported and print some details of the exception to try and determine why it can't > find that module... I can find axscript only as .pyd in win32comext.axscript.axscript and axdebug as directory win32comext.axdebug I tried to import axscript directly in my code with disabled debugger import win32comext.axscript.axscript and got the following error message: ImportError: No module named win32comext.axscript.axscript PYTHONHOME contains the path to the root installation directory and PATH too. Any remarks? Many thanks and greetings Udo > On 14/02/2013 8:32 PM, Udo Weik wrote: >> Hello again Mark, >> >>>> thanks for your answer. >>>> >>>>> Debugging should work "out of the box" - what problems are you seeing? >>>> >>>> I'm using a Delphi-component. That component checks whether the >>>> ActiveX debug interface is available (Windows Scripting Host, WSH). >>>> When I start my app, I get the following error message: >>>> >>>> Project XYZ.exe raised exception class EOleSysError with message >>>> 'Script engine does not support debugging.'. >>> >>> You could try registering the script engine with debugging support - >>> change to the win32comext/axscript/client directory and execute >>> "python pyscript.py --debug". Then, before loading the script >>> engine, execute "python -m win32traceutil". In the win32traceutil >>> window you should see some output generated - hopefully something >>> there will point us in the right direction. >> >> yep, many thanks for that hint. Tried it with the following result: >> >> ...\Python26\Lib\site-packages\win32comext\axscript\client>python >> pyscript.py --debug >> Registered: Python (for debugging) >> >> >> ...Python26\Lib\site-packages\win32comext\axscript\client>python -m >> win32traceutil >> >> Collecting Python Trace Output... >> Object with win32trace dispatcher created (object=None) >> in > 0x03436AA8>._InvokeEx_-InitNew() [1,0,None] >> in > 0x03436AA8>._InvokeEx_-SetScriptSite(> with obj at 0x02159724>,) [1,0,None] >> Debugging extensions (axdebug) module does not exist - debugging is >> disabled.. >> in > 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >> in > 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >> >> I'm a little bit confused - registering for debugging was possible, but >> the debug extensions aren't found. Just as a hint: I didn't use the >> standard >> installation pathes. >> >> >> Many thanks and greetings >> Udo >> >> >>>>> On 11/02/2013 3:07 AM, Udo Weik wrote: >>>>>> Hello, >>>>>> >>>>>> I want to use the standard Python 2.6 distribution from >>>>>> www.python.org as a Windows Scripting Host (WSH) scripting >>>>>> language. Is there any way to get debugging working with the >>>>>> WSH? From mhammond at skippinet.com.au Fri Feb 15 01:05:23 2013 From: mhammond at skippinet.com.au (Mark Hammond) Date: Fri, 15 Feb 2013 11:05:23 +1100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511D7421.6030202@aol.com> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> <511C33AE.2050605@gmail.com> <511CAF17.7030008@aol.com> <511D63D8.7020204@skippinet.com.au> <511D7421.6030202@aol.com> Message-ID: <511D7BC3.1010109@skippinet.com.au> On 15/02/2013 10:32 AM, Udo Weik wrote: > Hello Mark, > >> >>> import win32com.axscript.axscript >> >>> import win32com.axdebug. >> >> And see if that works? If so, maybe try and edit >> win32com\axscript\client\framework.py, find the error message you >> reported and print some details of the exception to try and determine >> why it can't >> find that module... > > I can find axscript only as .pyd in > win32comext.axscript.axscript > and axdebug as directory > win32comext.axdebug > > I tried to import axscript directly in my code with disabled debugger > import win32comext.axscript.axscript > and got the following error message: > ImportError: No module named win32comext.axscript.axscript Just "win32com", not "win32comext" - the different in the file-system paths is an implementation detail, but "win32comext" doesn't work as a package name. Cheers, Mark > > PYTHONHOME contains the path to the root installation directory > and PATH too. > > Any remarks? > > > Many thanks and greetings > Udo > > >> On 14/02/2013 8:32 PM, Udo Weik wrote: >>> Hello again Mark, >>> >>>>> thanks for your answer. >>>>> >>>>>> Debugging should work "out of the box" - what problems are you >>>>>> seeing? >>>>> >>>>> I'm using a Delphi-component. That component checks whether the >>>>> ActiveX debug interface is available (Windows Scripting Host, WSH). >>>>> When I start my app, I get the following error message: >>>>> >>>>> Project XYZ.exe raised exception class EOleSysError with message >>>>> 'Script engine does not support debugging.'. >>>> >>>> You could try registering the script engine with debugging support - >>>> change to the win32comext/axscript/client directory and execute >>>> "python pyscript.py --debug". Then, before loading the script >>>> engine, execute "python -m win32traceutil". In the win32traceutil >>>> window you should see some output generated - hopefully something >>>> there will point us in the right direction. >>> >>> yep, many thanks for that hint. Tried it with the following result: >>> >>> ...\Python26\Lib\site-packages\win32comext\axscript\client>python >>> pyscript.py --debug >>> Registered: Python (for debugging) >>> >>> >>> ...Python26\Lib\site-packages\win32comext\axscript\client>python -m >>> win32traceutil >>> >>> Collecting Python Trace Output... >>> Object with win32trace dispatcher created (object=None) >>> in >> 0x03436AA8>._InvokeEx_-InitNew() [1,0,None] >>> in >> 0x03436AA8>._InvokeEx_-SetScriptSite(>> with obj at 0x02159724>,) [1,0,None] >>> Debugging extensions (axdebug) module does not exist - debugging is >>> disabled.. >>> in >> 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >>> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >>> in >> 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >>> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >>> >>> I'm a little bit confused - registering for debugging was possible, but >>> the debug extensions aren't found. Just as a hint: I didn't use the >>> standard >>> installation pathes. >>> >>> >>> Many thanks and greetings >>> Udo >>> >>> >>>>>> On 11/02/2013 3:07 AM, Udo Weik wrote: >>>>>>> Hello, >>>>>>> >>>>>>> I want to use the standard Python 2.6 distribution from >>>>>>> www.python.org as a Windows Scripting Host (WSH) scripting >>>>>>> language. Is there any way to get debugging working with the >>>>>>> WSH? From WeikEngOff at aol.com Fri Feb 15 10:37:53 2013 From: WeikEngOff at aol.com (Udo Weik) Date: Fri, 15 Feb 2013 10:37:53 +0100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511D7BC3.1010109@skippinet.com.au> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> <511C33AE.2050605@gmail.com> <511CAF17.7030008@aol.com> <511D63D8.7020204@skippinet.com.au> <511D7421.6030202@aol.com> <511D7BC3.1010109@skippinet.com.au> Message-ID: <511E01F1.3000304@aol.com> Hello Mark, >>> >>> import win32com.axscript.axscript >>> >>> import win32com.axdebug.axdebug >>> >>> And see if that works? If so, maybe try and edit >>> win32com\axscript\client\framework.py, find the error message you >>> reported and print some details of the exception to try and determine >>> why it can't >>> find that module... >> >> I can find axscript only as .pyd in >> win32comext.axscript.axscript >> and axdebug as directory >> win32comext.axdebug >> >> I tried to import axscript directly in my code with disabled debugger >> import win32comext.axscript.axscript >> and got the following error message: >> ImportError: No module named win32comext.axscript.axscript > > Just "win32com", not "win32comext" - the different in the file-system paths is an implementation detail, but "win32comext" doesn't work as a package name. import win32com.axscript.axscript that works import win32com.axdebug.axdebug that works not, don't have any axdebug-file. Many thanks and greetings Udo >> PYTHONHOME contains the path to the root installation directory >> and PATH too. >> >> Any remarks? >> >> >> Many thanks and greetings >> Udo >> >> >>> On 14/02/2013 8:32 PM, Udo Weik wrote: >>>> Hello again Mark, >>>> >>>>>> thanks for your answer. >>>>>> >>>>>>> Debugging should work "out of the box" - what problems are you >>>>>>> seeing? >>>>>> >>>>>> I'm using a Delphi-component. That component checks whether the >>>>>> ActiveX debug interface is available (Windows Scripting Host, WSH). >>>>>> When I start my app, I get the following error message: >>>>>> >>>>>> Project XYZ.exe raised exception class EOleSysError with message >>>>>> 'Script engine does not support debugging.'. >>>>> >>>>> You could try registering the script engine with debugging support - >>>>> change to the win32comext/axscript/client directory and execute >>>>> "python pyscript.py --debug". Then, before loading the script >>>>> engine, execute "python -m win32traceutil". In the win32traceutil >>>>> window you should see some output generated - hopefully something >>>>> there will point us in the right direction. >>>> >>>> yep, many thanks for that hint. Tried it with the following result: >>>> >>>> ...\Python26\Lib\site-packages\win32comext\axscript\client>python >>>> pyscript.py --debug >>>> Registered: Python (for debugging) >>>> >>>> >>>> ...Python26\Lib\site-packages\win32comext\axscript\client>python -m >>>> win32traceutil >>>> >>>> Collecting Python Trace Output... >>>> Object with win32trace dispatcher created (object=None) >>>> in >>> 0x03436AA8>._InvokeEx_-InitNew() [1,0,None] >>>> in >>> 0x03436AA8>._InvokeEx_-SetScriptSite(>>> with obj at 0x02159724>,) [1,0,None] >>>> Debugging extensions (axdebug) module does not exist - debugging is >>>> disabled.. >>>> in >>> 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >>>> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >>>> in >>> 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >>>> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >>>> >>>> I'm a little bit confused - registering for debugging was possible, but >>>> the debug extensions aren't found. Just as a hint: I didn't use the >>>> standard >>>> installation pathes. >>>> >>>> >>>> Many thanks and greetings >>>> Udo >>>> >>>> >>>>>>> On 11/02/2013 3:07 AM, Udo Weik wrote: >>>>>>>> Hello, >>>>>>>> >>>>>>>> I want to use the standard Python 2.6 distribution from >>>>>>>> www.python.org as a Windows Scripting Host (WSH) scripting >>>>>>>> language. Is there any way to get debugging working with the >>>>>>>> WSH? From mhammond at skippinet.com.au Mon Feb 18 01:55:52 2013 From: mhammond at skippinet.com.au (Mark Hammond) Date: Mon, 18 Feb 2013 11:55:52 +1100 Subject: [python-win32] Python 2.6: Windows Scripting Host (WSH) compatible debugger In-Reply-To: <511E01F1.3000304@aol.com> References: <51181C04.8090904@gmail.com> <511A6B19.9040301@aol.com> <511C33AE.2050605@gmail.com> <511CAF17.7030008@aol.com> <511D63D8.7020204@skippinet.com.au> <511D7421.6030202@aol.com> <511D7BC3.1010109@skippinet.com.au> <511E01F1.3000304@aol.com> Message-ID: <51217C18.7050006@skippinet.com.au> Hrm - I can't explain that. A quick check of the 218 release shows that .pyd file exists in both the 2.7 and 3.3 builds, both 32 and 64bit versions (I didn't check all of them, but I'm guessing they are in the rest too) What version of Python and pywin32 are you using? If you are using build 218, can you try re-installing? If you aren't using 218, try using that (I recall some earlier builds didn't have it due to the available SDKs at the time not having that support) Mark On 15/02/2013 8:37 PM, Udo Weik wrote: > Hello Mark, > >>>> >>> import win32com.axscript.axscript >>>> >>> import win32com.axdebug.axdebug >>>> >>>> And see if that works? If so, maybe try and edit >>>> win32com\axscript\client\framework.py, find the error message you >>>> reported and print some details of the exception to try and determine >>>> why it can't >>>> find that module... >>> >>> I can find axscript only as .pyd in >>> win32comext.axscript.axscript >>> and axdebug as directory >>> win32comext.axdebug >>> >>> I tried to import axscript directly in my code with disabled debugger >>> import win32comext.axscript.axscript >>> and got the following error message: >>> ImportError: No module named win32comext.axscript.axscript >> >> Just "win32com", not "win32comext" - the different in the file-system >> paths is an implementation detail, but "win32comext" doesn't work as a >> package name. > > import win32com.axscript.axscript > that works > import win32com.axdebug.axdebug > that works not, don't have any axdebug-file. > > > Many thanks and greetings > Udo > > >>> PYTHONHOME contains the path to the root installation directory >>> and PATH too. >>> >>> Any remarks? >>> >>> >>> Many thanks and greetings >>> Udo >>> >>> >>>> On 14/02/2013 8:32 PM, Udo Weik wrote: >>>>> Hello again Mark, >>>>> >>>>>>> thanks for your answer. >>>>>>> >>>>>>>> Debugging should work "out of the box" - what problems are you >>>>>>>> seeing? >>>>>>> >>>>>>> I'm using a Delphi-component. That component checks whether the >>>>>>> ActiveX debug interface is available (Windows Scripting Host, WSH). >>>>>>> When I start my app, I get the following error message: >>>>>>> >>>>>>> Project XYZ.exe raised exception class EOleSysError with message >>>>>>> 'Script engine does not support debugging.'. >>>>>> >>>>>> You could try registering the script engine with debugging support - >>>>>> change to the win32comext/axscript/client directory and execute >>>>>> "python pyscript.py --debug". Then, before loading the script >>>>>> engine, execute "python -m win32traceutil". In the win32traceutil >>>>>> window you should see some output generated - hopefully something >>>>>> there will point us in the right direction. >>>>> >>>>> yep, many thanks for that hint. Tried it with the following result: >>>>> >>>>> ...\Python26\Lib\site-packages\win32comext\axscript\client>python >>>>> pyscript.py --debug >>>>> Registered: Python (for debugging) >>>>> >>>>> >>>>> ...Python26\Lib\site-packages\win32comext\axscript\client>python -m >>>>> win32traceutil >>>>> >>>>> Collecting Python Trace Output... >>>>> Object with win32trace dispatcher created (object=None) >>>>> in >>>> 0x03436AA8>._InvokeEx_-InitNew() [1,0,None] >>>>> in >>>> 0x03436AA8>._InvokeEx_-SetScriptSite(>>>> 0x02B64BA0 >>>>> with obj at 0x02159724>,) [1,0,None] >>>>> Debugging extensions (axdebug) module does not exist - debugging is >>>>> disabled.. >>>>> in >>>> 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >>>>> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >>>>> in >>>> 0x03436AA8>._QueryInterface_ with unsupported IID IActiveScriptDebug32 >>>>> ({51973C10-CB0C-11D0-B5C9-00A0244A0E7A}) >>>>> >>>>> I'm a little bit confused - registering for debugging was possible, >>>>> but >>>>> the debug extensions aren't found. Just as a hint: I didn't use the >>>>> standard >>>>> installation pathes. >>>>> >>>>> >>>>> Many thanks and greetings >>>>> Udo >>>>> >>>>> >>>>>>>> On 11/02/2013 3:07 AM, Udo Weik wrote: >>>>>>>>> Hello, >>>>>>>>> >>>>>>>>> I want to use the standard Python 2.6 distribution from >>>>>>>>> www.python.org as a Windows Scripting Host (WSH) scripting >>>>>>>>> language. Is there any way to get debugging working with the >>>>>>>>> WSH?