From mhammond@skippinet.com.au Mon Jun 3 12:26:53 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Mon, 3 Jun 2002 21:26:53 +1000 Subject: [python-win32] New win32all versions Message-ID: I have released new versions of win32all for Python 2.1 and Python 2.2. Links to these versions can be found at http://starship.python.net/crew/mhammond/win32/Downloads.html Note that this announcement has not yet been made to python-list; these releases should be considered experimental. Please let me know if you install these builds. If I recieve enough success stories, I will make a general announcement. Thanks, Mark. From robin@reportlab.com Mon Jun 3 12:54:20 2002 From: robin@reportlab.com (Robin Becker) Date: Mon, 3 Jun 2002 12:54:20 +0100 Subject: [python-win32] New win32all versions In-Reply-To: References: Message-ID: <2BY8XWAsj1+8EwOU@jessikat.fsnet.co.uk> In message , Mark Hammond writes Tried out 147 seems good to me. Will try some more complex com stuff later. >I have released new versions of win32all for Python 2.1 and Python 2.2. >Links to these versions can be found at >http://starship.python.net/crew/mhammond/win32/Downloads.html > >Note that this announcement has not yet been made to python-list; these >releases should be considered experimental. Please let me know if you >install these builds. If I recieve enough success stories, I will make a >general announcement. > >Thanks, > >Mark. ...... -- Robin Becker From robin@reportlab.com Mon Jun 3 13:21:52 2002 From: robin@reportlab.com (Robin Becker) Date: Mon, 3 Jun 2002 13:21:52 +0100 Subject: [python-win32] New win32all versions In-Reply-To: <2BY8XWAsj1+8EwOU@jessikat.fsnet.co.uk> References: <2BY8XWAsj1+8EwOU@jessikat.fsnet.co.uk> Message-ID: In message <2BY8XWAsj1+8EwOU@jessikat.fsnet.co.uk>, Robin Becker writes >In message , >Mark Hammond writes > >Tried out 147 seems good to me. Will try some more complex com stuff >later. > whoops I have 2.2 so that's 148 -- Robin Becker From ficfic@hotmail.com Tue Jun 4 10:37:24 2002 From: ficfic@hotmail.com (yaronm _) Date: Tue, 04 Jun 2002 12:37:24 +0300 Subject: [python-win32] Setting owner of window's file Message-ID: I'm pacing a strange problem : Using the ACL editor tool of a file (file->properties->security->advanced->owner), I can set the owner of the file to a any vaild user-account.(*) But from programming using SetSecurityInfo I can only set the owner to logon-session's user or local-administrator, and if I try to set it to a any other vaild user-account I get the following error ERROR_INVALID_OWNER, ("This security ID may not be assigned as the owner of this object."). (*) Suppose I've a shared file a.txt with owner JOHN. I do logon with user DAN and change ownership of a.txt to DAN. When I'll logon as JOHN I will truly see that the new owner of a.txt is DAN. OWNER_SECURITY_INFORMATION _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com From mhammond@skippinet.com.au Tue Jun 4 14:24:55 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Tue, 4 Jun 2002 23:24:55 +1000 Subject: [python-win32] Setting owner of window's file In-Reply-To: Message-ID: > But from programming using SetSecurityInfo I can only set the owner to > logon-session's user or local-administrator, and if I try to set > it to a any > other vaild user-account I get the following error ERROR_INVALID_OWNER, > ("This security ID may not be assigned as the owner of this object."). Someone else here may have a better answer, but you are probably best off looking for examples of using SetSecurityInfo in any language - most likely C++. It can be trickey getting everything right, and is rarely only a single call to setup the security correctly. Try searching for that function at msdn.microsoft.com, looking for samples. Mark. From cedric.delfosse@freealter.com Wed Jun 5 14:54:01 2002 From: cedric.delfosse@freealter.com (=?ISO-8859-1?Q?C=E9dric?= Delfosse) Date: 05 Jun 2002 15:54:01 +0200 Subject: [python-win32] pythoncom, multithreading, Word Message-ID: <1023285241.18832.20.camel@ovronnaz> Hello, I'm writing a little server to convert MSWord document (windows 2000 pro with msoffice 2000 premium), using the ThreadingTCPServer class of python. In the handle part of my BaseRequestHandler, I do something like this:=20 pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED)=20 w =3D win32com.client.Dispatch('Word.Application')=20 w.Visible =3D 0=20 w.DisplayAlerts =3D 0=20 w.Documents.Open( FileName =3D filenamein )=20 wc =3D win32com.client.constants=20 w.ActiveDocument.SaveAs( FileName =3D filenameout, FileFormat =3D wc.wdFormatHTML )=20 w.Documents.Close(wc.wdDoNotSaveChanges)=20 w.Quit()=20 w =3D None=20 It works fine, except when multiple threads are making COM call in the same time. There I'm getting lots of exception, telling me that my call are discarded. I don't understand why (my COM knowledge is very basic and I didn't read the python/win32 book). I have found a site at http://ecpspooler.sourceforge.net/, where the guy propose a spooler to pipe COM in a queue, because: """ The problem, Microsoft Word can be automated externally to generate documents. It is, however, a single use COM server which means only a single instance can run at a time. If two programs try to generate Word documents at the same time they will, at best, write text back and forth into the same document, and, at worst, crash Word all together. """ I'm a little perplex. If I do this in a python session: >>> w =3D win32com.client.Dispatch('Word.Application') >>> w.Documents.Open( "C:\\toto.doc" ) >>> w2 =3D win32com.client.Dispatch('Word.Application') >>> w.Documents.Open( "C:\\titi.doc" ) It works fine. So why not when I use thread ? Should I catch every COM call and redo them when they failed ? I hope not :) Thanks in advance for your answer. --=20 C=E9dric Delfosse Free&ALter Soft 152, rue de Grigy - Technopole Metz 2000 57070 METZ tel : 03 87 75 11 74 fax : 03 87 75 19 26 From churmtom@hotmail.com Wed Jun 5 15:27:10 2002 From: churmtom@hotmail.com (Tom Churm) Date: Wed, 05 Jun 2002 16:27:10 +0200 Subject: [python-win32] Best Way to 'Dispose' of COM / Excel Message-ID: hi, i'm using python & COM on Win32 to create Excel files using 'win32com.client.dynamic'. i've tried to research the best way to close Excel at the end of my script, but, once in awhile, Excel still freezes or crashes (this happens maybe only 10% of the time). my question: is there a better way to close Excel and 'dispose' of my COM stuff at the end of my script, so that when something goes wrong in the running of the script, etc., Excel will not crash or act strangely? here's what i'm using now: ============================================= ExcelApp=win32com.client.dynamic.Dispatch("Excel.Application") ExcelApp.Visible = 0 workbook = ExcelApp.Workbooks.Add() ... workbook.SaveAs(Filename=thePath + "\\" + strExcelFileName + ".xls") workbook.Close(0) ExcelApp.Quit() ExcelApp = None ============================================= thanks much in advance! tom _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com From chris@psychofx.com Wed Jun 5 16:23:04 2002 From: chris@psychofx.com (Chris Miles) Date: Thu, 6 Jun 2002 01:23:04 +1000 Subject: [python-win32] pythoncom, multithreading, Word In-Reply-To: <1023285241.18832.20.camel@ovronnaz>; from cedric.delfosse@freealter.com on Wed, Jun 05, 2002 at 03:54:01PM +0200 References: <1023285241.18832.20.camel@ovronnaz> Message-ID: <20020606012304.E29804@psychofx.com> You should create a Semaphore object and semaphore lock your COM calls. Then only one thread at a time will be making a call. CM On Wed, Jun 05, 2002 at 03:54:01PM +0200, Cédric Delfosse wrote: > Hello, > > I'm writing a little server to convert MSWord document (windows 2000 pro > with msoffice 2000 premium), using the ThreadingTCPServer class of > python. > > In the handle part of my BaseRequestHandler, I do something like this: > > pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED) > w = win32com.client.Dispatch('Word.Application') > w.Visible = 0 > w.DisplayAlerts = 0 > w.Documents.Open( FileName = filenamein ) > wc = win32com.client.constants > w.ActiveDocument.SaveAs( FileName = filenameout, FileFormat = > wc.wdFormatHTML ) > w.Documents.Close(wc.wdDoNotSaveChanges) > w.Quit() > w = None > > It works fine, except when multiple threads are making COM call in the > same time. There I'm getting lots of exception, telling me that my call > are discarded. > > I don't understand why (my COM knowledge is very basic and I didn't read > the python/win32 book). > > I have found a site at http://ecpspooler.sourceforge.net/, where the guy > propose a spooler to pipe COM in a queue, because: > > """ > > The problem, Microsoft Word can be automated externally to generate > documents. It is, however, a single use COM server which means only a > single instance can run at a time. If two programs try to generate Word > documents at the same time they will, at best, write text back and forth > into the same document, and, at worst, crash Word all together. > > """ > > I'm a little perplex. If I do this in a python session: > > >>> w = win32com.client.Dispatch('Word.Application') > >>> w.Documents.Open( "C:\\toto.doc" ) > >>> w2 = win32com.client.Dispatch('Word.Application') > >>> w.Documents.Open( "C:\\titi.doc" ) > > It works fine. > So why not when I use thread ? Should I catch every COM call and redo > them when they failed ? I hope not :) > > Thanks in advance for your answer. > > -- > Cédric Delfosse Free&ALter Soft > 152, rue de Grigy - Technopole Metz 2000 57070 METZ > tel : 03 87 75 11 74 fax : 03 87 75 19 26 > > > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 -- Chris Miles chris@psychofx.com http://www.psychofx.com/chris/ From mhammond@skippinet.com.au Wed Jun 5 23:47:15 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Thu, 6 Jun 2002 08:47:15 +1000 Subject: [python-win32] Best Way to 'Dispose' of COM / Excel In-Reply-To: Message-ID: > here's what i'm using now: > ============================================= > ExcelApp=win32com.client.dynamic.Dispatch("Excel.Application") > ExcelApp.Visible = 0 > workbook = ExcelApp.Workbooks.Add() > ... > workbook.SaveAs(Filename=thePath + "\\" + strExcelFileName + ".xls") > workbook.Close(0) > ExcelApp.Quit() > ExcelApp = None > ============================================= > > thanks much in advance! That should be fine. However, just before terminating you should check that pythoncom._GetInterfaceCount() returns zero. If non-zero, it means that there is still a reference to a COM object somewhere in your program, and it should be removed. Mark. From cedric.delfosse@freealter.com Thu Jun 6 15:32:06 2002 From: cedric.delfosse@freealter.com (=?ISO-8859-1?Q?C=E9dric?= Delfosse) Date: 06 Jun 2002 16:32:06 +0200 Subject: [python-win32] pythoncom, multithreading, Word In-Reply-To: <1023285241.18832.20.camel@ovronnaz> References: <1023285241.18832.20.camel@ovronnaz> Message-ID: <1023373926.32124.4.camel@ovronnaz> The trick is to launch multiple Word with win32com.client.DispatchEx('Word.Application'). Then it works better. Le mer 05/06/2002 =E0 15:54, C=E9dric Delfosse a =E9crit : > Hello, >=20 > I'm writing a little server to convert MSWord document (windows 2000 pro > with msoffice 2000 premium), using the ThreadingTCPServer class of > python. >=20 > In the handle part of my BaseRequestHandler, I do something like this:=20 >=20 > pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED)=20 > w =3D win32com.client.Dispatch('Word.Application')=20 > w.Visible =3D 0=20 > w.DisplayAlerts =3D 0=20 > w.Documents.Open( FileName =3D filenamein )=20 > wc =3D win32com.client.constants=20 > w.ActiveDocument.SaveAs( FileName =3D filenameout, FileFormat =3D > wc.wdFormatHTML )=20 > w.Documents.Close(wc.wdDoNotSaveChanges)=20 > w.Quit()=20 > w =3D None=20 >=20 > It works fine, except when multiple threads are making COM call in the > same time. There I'm getting lots of exception, telling me that my call > are discarded. >=20 > I don't understand why (my COM knowledge is very basic and I didn't read > the python/win32 book). >=20 > I have found a site at http://ecpspooler.sourceforge.net/, where the guy > propose a spooler to pipe COM in a queue, because: >=20 > """ >=20 > The problem, Microsoft Word can be automated externally to generate > documents. It is, however, a single use COM server which means only a > single instance can run at a time. If two programs try to generate Word > documents at the same time they will, at best, write text back and forth > into the same document, and, at worst, crash Word all together. >=20 > """ >=20 > I'm a little perplex. If I do this in a python session: >=20 > >>> w =3D win32com.client.Dispatch('Word.Application') > >>> w.Documents.Open( "C:\\toto.doc" ) > >>> w2 =3D win32com.client.Dispatch('Word.Application') > >>> w.Documents.Open( "C:\\titi.doc" ) >=20 > It works fine. > So why not when I use thread ? Should I catch every COM call and redo > them when they failed ? I hope not :) >=20 > Thanks in advance for your answer. >=20 > --=20 > C=E9dric Delfosse Free&ALter Soft > 152, rue de Grigy - Technopole Metz 2000 57070 METZ > tel : 03 87 75 11 74 fax : 03 87 75 19 26 >=20 >=20 >=20 > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 --=20 C=E9dric Delfosse Free&ALter Soft 152, rue de Grigy - Technopole Metz 2000 57070 METZ tel : 03 87 75 11 74 fax : 03 87 75 19 26 From ajw126@york.ac.uk Sat Jun 8 15:48:00 2002 From: ajw126@york.ac.uk (Andrew Wilkinson) Date: Sat, 8 Jun 2002 15:48:00 +0100 Subject: [python-win32] CreateRgn Message-ID: <012d01c20efb$7c4a4ee0$0938fea9@andrewwpc> Hi, According the documentation I should be able to do this.. >>> import win32ui >>> win32ui.CreateRgn() Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'CreateRgn' but as you can see it fails. Any suggestions to get this working would be much appreciated. I'm running Python 2.2.1 and win32all-148 Regards, Andrew Wilkinson From mhammond@skippinet.com.au Sat Jun 8 16:24:11 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Sun, 9 Jun 2002 01:24:11 +1000 Subject: [python-win32] CreateRgn In-Reply-To: <012d01c20efb$7c4a4ee0$0938fea9@andrewwpc> Message-ID: > According the documentation I should be able to do this.. Oops - I am afraid this was not exposed due to a simple error on my part. I have fixed it and checked it in. Mark. From w4kpm@adelphia.net Sun Jun 9 00:49:45 2002 From: w4kpm@adelphia.net (Kelly McDonald) Date: Sat, 8 Jun 2002 19:49:45 -0400 Subject: [python-win32] Package Py ActiveX object as self-register DLL?? Message-ID: <001301c20f47$2ad6a580$bf6f3318@chvlva.adelphia.net> This is a multi-part message in MIME format. ------=_NextPart_000_0010_01C20F25.A37A40E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello list, I am wanting to break away from MS products, and python looks as if it = will be my choice for many things. I do, however have some questions = about ActiveX objects. I am wanting to develop AX objects in python, but I want to wrap them up = into a self-contained DLL or OCX or something.=20 Is there a tool (like py2exe) that will allow me to do that? Or is there = another, NON MS tool that will allow me to do that with minimal/no = cost?? Any options will be appreciated. Thanks, Kelly McDonald. ------=_NextPart_000_0010_01C20F25.A37A40E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello list,
 
I am wanting to break away from MS = products, and=20 python looks as if it will be my choice for many things. I do, however = have some=20 questions about ActiveX objects.
 
I am wanting to develop AX objects in = python, but I=20 want to wrap them up into a self-contained DLL or OCX or something.=20
 
Is there a tool (like py2exe) that will = allow me to=20 do that? Or is there another, NON MS tool that will allow me to do that = with=20 minimal/no cost??
 
Any options will be = appreciated.
 
Thanks,
Kelly = McDonald.
------=_NextPart_000_0010_01C20F25.A37A40E0-- From ajw126@student.cs.york.ac.uk Sun Jun 9 09:36:32 2002 From: ajw126@student.cs.york.ac.uk (Andrew Wilkinson) Date: Sun, 9 Jun 2002 09:36:32 +0100 Subject: [python-win32] CreateRgn References: Message-ID: <008701c20f90$c2562d10$0938fea9@andrewwpc> Thanks for fixing that, I've checked out the cvs code, compiled it and it works fine. Unfortunately however there were a couple of missing api calls that I needed. CRgn::CreateEllipticRgn and CWnd::SetWindowRgn to be precise, I have implemented these in my copy of the source code and they work fine. I now have a non-rectangular window created by Python. This isn't a very good solution however as I don't want to rely on features that I've added to the extension. I was wondering if it would be possible to get these functions, and probably CWnd::GetWindowRgn for completeness, added to the cvs. I don't know if you accept contributions to the code, if you do please tell me how you want the sourcecode submitted and I'll send you what I've done, its only about 40 lines. Regards, Andrew Wilkinson ----- Original Message ----- From: "Mark Hammond" To: "Andrew Wilkinson" ; Sent: Saturday, June 08, 2002 4:24 PM Subject: RE: [python-win32] CreateRgn > > According the documentation I should be able to do this.. > > Oops - I am afraid this was not exposed due to a simple error on my part. I > have fixed it and checked it in. > > Mark. > > > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > From mhammond@skippinet.com.au Mon Jun 10 01:26:51 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Mon, 10 Jun 2002 10:26:51 +1000 Subject: [python-win32] CreateRgn In-Reply-To: <008701c20f90$c2562d10$0938fea9@andrewwpc> Message-ID: > I was wondering if it would be possible to get these functions, > and probably > CWnd::GetWindowRgn for completeness, added to the cvs. I don't know if you > accept contributions to the code, if you do please tell me how > you want the > sourcecode submitted and I'll send you what I've done, its only about 40 > lines. Absolutely. Send me a context or unified diff against the current CVS version, and I will check it straight in! Thanks, Mark. From niki@vintech.bg Mon Jun 10 09:36:39 2002 From: niki@vintech.bg (Niki Spahiev) Date: Mon, 10 Jun 2002 11:36:39 +0300 Subject: [python-win32] Package Py ActiveX object as self-register DLL?? References: <001301c20f47$2ad6a580$bf6f3318@chvlva.adelphia.net> Message-ID: <3D046517.8090602@vintech.bg> Kelly McDonald wrote: > Hello list, > > I am wanting to break away from MS products, and python looks as if it > will be my choice for many things. I do, however have some questions > about ActiveX objects. > > I am wanting to develop AX objects in python, but I want to wrap them up > into a self-contained DLL or OCX or something. > > Is there a tool (like py2exe) that will allow me to do that? Or is there > another, NON MS tool that will allow me to do that with minimal/no cost?? > > Any options will be appreciated. > > Thanks, > Kelly McDonald. You can use Python Installer from McMillan plus small patch from me. HTH Niki Spahiev From churmtom@hotmail.com Mon Jun 10 15:26:58 2002 From: churmtom@hotmail.com (Tom Churm) Date: Mon, 10 Jun 2002 16:26:58 +0200 Subject: [python-win32] Protecting Packaged Python Apps Message-ID: hi, 1st, let me say that this is perhaps not the appropriate list for such a question, but i can't find a list based on the topic of packaging python code into .exe's for distribution. wouldn't there be enough demand for an extra list on this topic? i'm interested in packaging my python scripts into .exe's, and am already doing this using py2exe or the Installer module. my questions are: 1)can python be considered a serious candidate for creating commercial applications, or should i be using a different language (such as--ugh--some flavor of C)? 2)is decompiling a python '.exe' easily done, and how? 3)how do i protect the resulting .exe's against others decompiling them? 4)is there perhaps a way to encode python script before freezing it? muchos gracias, tom _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com From itamarst@yahoo.com Mon Jun 10 16:00:36 2002 From: itamarst@yahoo.com (Itamar S.-T.) Date: Mon, 10 Jun 2002 08:00:36 -0700 (PDT) Subject: [python-win32] Protecting Packaged Python Apps In-Reply-To: Message-ID: <20020610150036.76538.qmail@web13007.mail.yahoo.com> --- Tom Churm wrote: > 1)can python be considered a serious candidate for > creating commercial > applications, or should i be using a different > language (such as--ugh--some > flavor of C)? Yep. There are companies selling commercial, proprietary software written in Python. > 2)is decompiling a python '.exe' easily done, and > how? Yes - py2exe is just a ZIP or maybe gzip archive. > 3)how do i protect the resulting .exe's against > others decompiling them? Can't be done. .pyc files are easily decompiled into source code that is almost identical to original using program called decompyle. > 4)is there perhaps a way to encode python script > before freezing it? No - Python is way too dynamic for that to work. You could do something like encrypting the source, but the key would have to be in the package - I suppose you could make a C extension that stores the key internally and use that to decrypt python source code on the fly. ===== Itamar Shtull-Trauring, itamar(at)shtull-trauring.org __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com From jeff@ccvcorp.com Mon Jun 10 19:51:51 2002 From: jeff@ccvcorp.com (Jeff Shannon) Date: Mon, 10 Jun 2002 11:51:51 -0700 Subject: [python-win32] Protecting Packaged Python Apps References: <20020610160009.3693.88358.Mailman@mail.python.org> Message-ID: <3D04F546.A4E743B6@ccvcorp.com> > --- Tom Churm wrote: > > 4)is there perhaps a way to encode python script > > before freezing it? > > No - Python is way too dynamic for that to work. You > could do something like encrypting the source, but the > key would have to be in the package - I suppose you > could make a C extension that stores the key > internally and use that to decrypt python source code > on the fly. Note, however, that it's very difficult to protect even compiled-C exe's from piracy. Look at how many "cracks" are available for all sorts of commercial software -- it's virtually impossible to make uncrackable software. Anyone who's determined enough to decrypt/reverse engineer the code in your py2exe files is probably going to be able to break any *other* security measures you use, too. Your efforts are probably better spent in creating a usable licensing scheme that encourages people to pay, rather than in trying to create a "secure" executable. Jeff Shannon Technician/Programmer Credit International From john@hopkinsit.com Tue Jun 11 03:53:12 2002 From: john@hopkinsit.com (John Hopkins) Date: Mon, 10 Jun 2002 19:53:12 -0700 Subject: [python-win32] Problem with built-in str() function Message-ID: <001f01c210f3$21181940$0201a8c0@john> This is a multi-part message in MIME format. ------=_NextPart_000_001C_01C210B8.73B565D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The other day, str() "stopped working" for me. Here's what I mean. I have this bit of code in a wxPython app: for x in range(len(items)): DateValue =3D items[x][1] if DateValue !=3D 'N/A': DisplayDate =3D '%s/%s/%s' % = (DateValue[5:7],DateValue[8:10],DateValue[0:4]) else: DisplayDate =3D DateValue self.SearchList.InsertStringItem(x, items[x][0]) self.SearchList.SetStringItem(x, 1, DisplayDate) print 'items[x][2] =3D %s' % items[x][2] self.SearchList.SetStringItem(x, 2, str(items[x][2])) self.SearchList.SetItemData(x, items[x][2]) Often as not the loop only iterates once (the list only has a single = element). When this line executes: self.SearchList.SetStringItem(x, 2, str(items[x][2])) I get the following output: items[x][2] =3D 3 Traceback (most recent call last): File "LabTracker_Dev.py", line 356, in OnFindClick self.SearchList.SetStringItem(x, 2, str(items[x][2])) TypeError: 'str' object is not callable This is so basic that I'm utterly lost. I feel silly, but can anybody help me with this? Thanks, John ------=_NextPart_000_001C_01C210B8.73B565D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
The other day, str() "stopped working" = for me.=20 Here's what I mean.
 
I have this bit of code in a wxPython=20 app:
 
        for x in=20 range(len(items)):
        &nb= sp;  =20 DateValue =3D=20 items[x][1]
         &nbs= p; =20 if DateValue !=3D=20 'N/A':
          &nb= sp;    =20 DisplayDate =3D '%s/%s/%s' %=20 (DateValue[5:7],DateValue[8:10],DateValue[0:4])
   &nbs= p;       =20 else:
          &nbs= p;    =20 DisplayDate =3D=20 DateValue
          =  =20 self.SearchList.InsertStringItem(x,=20 items[x][0])
         &nb= sp; =20 self.SearchList.SetStringItem(x, 1,=20 DisplayDate)
         &nb= sp; =20 print 'items[x][2] =3D %s' %=20 items[x][2]
         &nbs= p; =20 self.SearchList.SetStringItem(x, 2,=20 str(items[x][2]))
        &nbs= p;  =20 self.SearchList.SetItemData(x, items[x][2])
Often as not the loop only iterates = once (the list=20 only has a single element).  When this line = executes:
 
          &nbs= p;=20 self.SearchList.SetStringItem(x, 2, str(items[x][2]))
I get the following = output:
 
items[x][2] =3D 3
Traceback (most = recent call=20 last):
  File "LabTracker_Dev.py", line 356, in=20 OnFindClick
    self.SearchList.SetStringItem(x, 2,=20 str(items[x][2]))
TypeError: 'str' object is not = callable
 
 This is so basic that I'm utterly = lost.
 
I feel silly, but can anybody help me = with=20 this?
 
Thanks,
 
John
 
------=_NextPart_000_001C_01C210B8.73B565D0-- From john@hopkinsit.com Tue Jun 11 04:24:27 2002 From: john@hopkinsit.com (John Hopkins) Date: Mon, 10 Jun 2002 20:24:27 -0700 Subject: [python-win32] Problem with built-in str() function References: <001f01c210f3$21181940$0201a8c0@john> <20020611031052.GA13668@ritsuko.xware.cx> Message-ID: <001a01c210f7$7e648a80$0201a8c0@john> Yep. that was it. How embarrassing ... John ----- Original Message ----- From: "Andrew Bennetts" To: "John Hopkins" Cc: Sent: Monday, June 10, 2002 8:10 PM Subject: Re: [python-win32] Problem with built-in str() function > On Mon, Jun 10, 2002 at 07:53:12PM -0700, John Hopkins wrote: > > I get the following output: > > > > items[x][2] = 3 > > Traceback (most recent call last): > > File "LabTracker_Dev.py", line 356, in OnFindClick > > self.SearchList.SetStringItem(x, 2, str(items[x][2])) > > TypeError: 'str' object is not callable > > > > This is so basic that I'm utterly lost. > > > > I feel silly, but can anybody help me with this? > > Search for "str = " or "def ...(..., str, ...)" in your source. You > almost certainly are using "str" as a variable, thus overriding the > builtin. Perhaps pychecker (http://pychecker.sf.net/) might help you > find where you've overridden str -- but I'm not sure if it does that. > > -Andrew. > > > From andrew@puzzling.org Tue Jun 11 04:10:52 2002 From: andrew@puzzling.org (Andrew Bennetts) Date: Tue, 11 Jun 2002 13:10:52 +1000 Subject: [python-win32] Problem with built-in str() function In-Reply-To: <001f01c210f3$21181940$0201a8c0@john> References: <001f01c210f3$21181940$0201a8c0@john> Message-ID: <20020611031052.GA13668@ritsuko.xware.cx> On Mon, Jun 10, 2002 at 07:53:12PM -0700, John Hopkins wrote: > I get the following output: > > items[x][2] = 3 > Traceback (most recent call last): > File "LabTracker_Dev.py", line 356, in OnFindClick > self.SearchList.SetStringItem(x, 2, str(items[x][2])) > TypeError: 'str' object is not callable > > This is so basic that I'm utterly lost. > > I feel silly, but can anybody help me with this? Search for "str = " or "def ...(..., str, ...)" in your source. You almost certainly are using "str" as a variable, thus overriding the builtin. Perhaps pychecker (http://pychecker.sf.net/) might help you find where you've overridden str -- but I'm not sure if it does that. -Andrew. From mhammond@skippinet.com.au Tue Jun 11 08:25:41 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Tue, 11 Jun 2002 17:25:41 +1000 Subject: [python-win32] Straw poll - Python 2.0 and earlier usage Message-ID: Hi all, I'm taking a little straw poll here. I am wondering who uses any Python pre 2.1, and still updates win32all builds. In a nutshell, I am wondering if anyone would even notice if I never released another win32all update for pre-Python 2.0 or 1.5.2. If you would notice, and feel a little left out in the cold, please mail me. If no one does, I will try c.l.py Thanks, Mark. From Juhani.Mantila@novogroup.com Tue Jun 11 09:07:30 2002 From: Juhani.Mantila@novogroup.com (Mantila Juhani) Date: Tue, 11 Jun 2002 11:07:30 +0300 Subject: [python-win32] Package Py ActiveX object as self-register DLL ?? Message-ID: Hello, I'm interested, too, but I'd ask you to be a bit more specific, pls. Where's McMillan ? Here's an other: I've got a buch of interfaces to implement ( an olb = file ). Best way to implement those ? I just learned that some of the classes in concern don't implement IDispatch and makepy won't produce all the = stuff. Juhani > -----Original Message----- > From: Niki Spahiev [mailto:niki@vintech.bg] > Sent: 10. kes=E4kuuta 2002 11:37 > To: Kelly McDonald > Cc: python-win32@python.org > Subject: Re: [python-win32] Package Py ActiveX object as = self-register > DLL?? >=20 >=20 > Kelly McDonald wrote: > > Hello list, > > =20 > > I am wanting to break away from MS products, and python=20 > looks as if it=20 > > will be my choice for many things. I do, however have some=20 > questions=20 > > about ActiveX objects. > > =20 > > I am wanting to develop AX objects in python, but I want to=20 > wrap them up=20 > > into a self-contained DLL or OCX or something. > > =20 > > Is there a tool (like py2exe) that will allow me to do=20 > that? Or is there=20 > > another, NON MS tool that will allow me to do that with=20 > minimal/no cost?? > > =20 > > Any options will be appreciated. > > =20 > > Thanks, > > Kelly McDonald. >=20 > You can use Python Installer from McMillan plus small patch from me. >=20 > HTH > Niki Spahiev >=20 >=20 >=20 >=20 > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 >=20 From niki@vintech.bg Tue Jun 11 09:34:54 2002 From: niki@vintech.bg (Niki Spahiev) Date: Tue, 11 Jun 2002 11:34:54 +0300 Subject: [python-win32] Package Py ActiveX object as self-register DLL ?? References: Message-ID: <3D05B62E.2010700@vintech.bg> This is a multi-part message in MIME format. --------------080201020304040609080506 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mantila Juhani wrote: > Hello, > I'm interested, too, but I'd ask you to be a bit more specific, pls. > Where's McMillan ? > Here's an other: I've got a buch of interfaces to implement ( an olb file ). > Best way to implement those ? I just learned that some of the classes > in concern don't implement IDispatch and makepy won't produce all the stuff. > > Juhani http://www.mcmillan-inc.com/install5_ann.html there is mailing list where i posted the patch. For non IDispatch interfacer i have no experience. HTH Niki Spahiev --------------080201020304040609080506 Content-Type: text/plain; name="comdll.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="comdll.patch" diff -r -u app/installer/MakeCOMServer.py code/installer/MakeCOMServer.py --- app/installer/MakeCOMServer.py Thu Jan 24 17:10:30 2002 +++ code/installer/MakeCOMServer.py Sun Mar 24 16:55:54 2002 @@ -6,7 +6,7 @@ %(mod)s.%(klass)s._reg_options_ = {'InprocServer32': os.path.abspath( os.path.join( - os.path.dirname(sys.executable), "%(dllname)s"))} + os.path.dirname(sys.argv[0]), "%(dllname)s"))} """ #mod, klass, dllname tmplt = """\ import sys diff -r -u app/installer/source/windows/dllmain.c code/installer/source/windows/dllmain.c --- app/installer/source/windows/dllmain.c Thu Feb 14 16:56:20 2002 +++ code/installer/source/windows/dllmain.c Sun Mar 24 16:32:38 2002 @@ -18,7 +18,8 @@ void releasePythonCom(void); HINSTANCE gInstance; -int launch(char const * archivePath, char const * archiveName) +int launch(char const * archivePath, char const * archiveName, + char const * regUnreg) // NIKI { static PyInterpreterState *interp = NULL; PyThreadState *thisthread; @@ -41,9 +42,13 @@ return -1; if (loadedNew) { + int argc = 1; + char const * argv[2] = { pathnm }; + if (regUnreg) + argv[argc++] = regUnreg; /* Start Python with silly command line */ PyEval_InitThreads(); - if (startPython(1, (char**)&pathnm)) + if (startPython(argc, argv)) return -1; VS("Started new Python"); thisthread = PyThreadState_Swap(NULL); @@ -101,7 +106,7 @@ return 0; } -void startUp() +void startUp(char const * regUnreg) { char thisfile[_MAX_PATH + 1]; char *p; @@ -119,7 +124,7 @@ len = p - here; //VS(here); //VS(&thisfile[len]); - launch(here, &thisfile[len]); + launch(here, &thisfile[len], regUnreg); LoadPythonCom(); // Now Python is up and running (any scripts have run) } @@ -199,7 +204,7 @@ sprintf(msg, "DllCanUnloadNow from thread %x", GetCurrentThreadId()); VS(msg); if (gPythoncom == 0) - startUp(); + startUp(NULL); rc = Pyc_DllCanUnloadNow(); sprintf(msg, "DllCanUnloadNow returns %x", rc); VS(msg); @@ -216,7 +221,7 @@ sprintf(msg, "DllGetClassObject from thread %x", GetCurrentThreadId()); VS(msg); if (gPythoncom == 0) - startUp(); + startUp(NULL); rc = Pyc_DllGetClassObject(rclsid, riid, ppv); sprintf(msg, "DllGetClassObject set %x and returned %x", *ppv, rc); VS(msg); @@ -229,13 +234,33 @@ sprintf(msg, "DllRegisterServerEx from thread %x", GetCurrentThreadId()); VS(msg); if (gPythoncom == 0) - startUp(); + startUp(NULL); return Pyc_DllRegisterServerEx(fileName); } __declspec(dllexport) int DllUnregisterServerEx(LPCSTR fileName) { if (gPythoncom == 0) - startUp(); + startUp(NULL); return Pyc_DllUnregisterServerEx(fileName); +} + +__declspec(dllexport) HRESULT DllRegisterServer() // NIKI +{ + char msg[40]; + sprintf(msg, "DllRegisterServer from thread %x", GetCurrentThreadId()); + VS(msg); + if (gPythoncom == 0) + startUp("--register"); + return S_OK; +} + +__declspec(dllexport) HRESULT DllUnregisterServer() // NIKI +{ + char msg[40]; + sprintf(msg, "DllRegisterServer from thread %x", GetCurrentThreadId()); + VS(msg); + if (gPythoncom == 0) + startUp("--unregister"); + return S_OK; } --------------080201020304040609080506-- From mhammond@skippinet.com.au Tue Jun 11 13:31:06 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Tue, 11 Jun 2002 22:31:06 +1000 Subject: [python-win32] Package Py ActiveX object as self-register DLL?? In-Reply-To: Message-ID: > Hello, > I'm interested, too, but I'd ask you to be a bit more specific, pls. > Where's McMillan ? > Here's an other: I've got a buch of interfaces to implement ( an > olb file ). > Best way to implement those ? I just learned that some of the classes > in concern don't implement IDispatch and makepy won't produce all > the stuff. makepy should generate everything you need to implement non IDispatch based interfaces. See win32com\test\test_pycomtest.py. Let me know if you have problems... Mark. From terjeja@hotmail.com Tue Jun 11 23:31:01 2002 From: terjeja@hotmail.com (Terje Johan Abrahamsen) Date: Tue, 11 Jun 2002 22:31:01 +0000 Subject: [python-win32] Win32com/Excel Message-ID: I try to open Excel thru win32com. I write: >>>from win32com.client import Dispatch >>>xlApp = Dispatch("Excel.Application") >>>xlApp.Visible = 1 I get the frame of Excel, but not the spreadsheet. Even if I write: >>>xlApp.Workbooks.Add() it doesn't give me the ability to look whats there. I get the frame around the spreadsheet, and the menues at the top, as well as the paperclip. The paperclip works, the menus are selectable, but does not work. And the space where the spreadsheet should have been gives me a "picture" of what is on the desktop. (Other open windows in the background and so forth). I can move the Excel frame around, and the background follows along. I use the newest version of both Python and Win32com, and have tried this on two computers. 1 with Win98 and 1 with win2k. Same result... Anyone seen this before? And managed to solve it? Thanks, Terje _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. From mhammond@skippinet.com.au Wed Jun 12 04:08:24 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Wed, 12 Jun 2002 13:08:24 +1000 Subject: [python-win32] Win32com/Excel In-Reply-To: Message-ID: > I try to open Excel thru win32com. I write: > >>>from win32com.client import Dispatch > >>>xlApp = Dispatch("Excel.Application") > >>>xlApp.Visible = 1 > > I get the frame of Excel, but not the spreadsheet. Even if I write: > >>>xlApp.Workbooks.Add() > it doesn't give me the ability to look whats there. I get the > frame around > the spreadsheet, and the menues at the top, as well as the paperclip. The > paperclip works, the menus are selectable, but does not work. And > the space > where the spreadsheet should have been gives me a "picture" of what is on > the desktop. (Other open windows in the background and so forth). > I can move > the Excel frame around, and the background follows along. I use > the newest > version of both Python and Win32com, and have tried this on two > computers. 1 > with Win98 and 1 with win2k. Same result... Anyone seen this before? And > managed to solve it? On my machine, your code seems to work fine - excel repaints and is fully responsive. The new worksheet is created and can be interacted with. This occasionally happens when an existing Excel instance is already running. If your program crashed the last time you ran it, you may need to kill the Excel.exe process manually. If you see this behaviour inside a more complex app only, then it may be that you need to occasionally pump a message loop - pythoncom.PumpWaitingMessages() is often suitable. Mark. From pythontutor@venix.com Wed Jun 12 00:29:36 2002 From: pythontutor@venix.com (Lloyd Kvam) Date: Tue, 11 Jun 2002 19:29:36 -0400 Subject: [python-win32] Re: [Tutor] Win32com/Excel References: Message-ID: <3D0687E0.8040006@venix.com> xlBook = xlApp.Workbooks.Add() sheet = xlBook.Worksheets('Sheet1') row1,col1,row2,col2 = 1,1,3,4 #3 rows, 4 cols return sheet.Range(sheet.Cells(row1, col1), sheet.Cells(row2, col2)).Value Terje Johan Abrahamsen wrote: > I try to open Excel thru win32com. I write: > >>>> from win32com.client import Dispatch >>>> xlApp = Dispatch("Excel.Application") >>>> xlApp.Visible = 1 >>> > > I get the frame of Excel, but not the spreadsheet. Even if I write: > >>>> xlApp.Workbooks.Add() >>> > it doesn't give me the ability to look whats there. I get the frame > around the spreadsheet, and the menues at the top, as well as the > paperclip. The paperclip works, the menus are selectable, but does not > work. And the space where the spreadsheet should have been gives me a > "picture" of what is on the desktop. (Other open windows in the > background and so forth). I can move the Excel frame around, and the > background follows along. I use the newest version of both Python and > Win32com, and have tried this on two computers. 1 with Win98 and 1 with > win2k. Same result... Anyone seen this before? And managed to solve it? > > Thanks, > Terje > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. > > > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Lloyd Kvam Venix Corp. 1 Court Street, Suite 378 Lebanon, NH 03766-1358 voice: 603-443-6155 fax: 801-459-9582 From David Rock Thu Jun 13 05:44:11 2002 From: David Rock (David Rock) Date: Wed, 12 Jun 2002 23:44:11 -0500 Subject: [python-win32] capturing stdout output from ftplib Message-ID: <20020612234411.A13646@wdfs.graniteweb.com> I would like to capture the output from ftp.dir() or ftp.retrlines( 'LIST' ), both of which output to stdout by default. Preferably, I would like this collected as a list of strings that I could split to get the filenames for comparison against an existing filename. I have found references to using a callback function as an argument, but I don't know how this would work, either. Thanks. -- David Rock david@rock.homelinux.com From andrew-pywin32@puzzling.org Thu Jun 13 06:01:00 2002 From: andrew-pywin32@puzzling.org (Andrew Bennetts) Date: Thu, 13 Jun 2002 15:01:00 +1000 Subject: [python-win32] capturing stdout output from ftplib In-Reply-To: <20020612234411.A13646@wdfs.graniteweb.com> References: <20020612234411.A13646@wdfs.graniteweb.com> Message-ID: <20020613050100.GA27586@ritsuko.xware.cx> On Wed, Jun 12, 2002 at 11:44:11PM -0500, David Rock wrote: > I would like to capture the output from ftp.dir() or ftp.retrlines( 'LIST' ), > both of which output to stdout by default. Preferably, I would like this > collected as a list of strings that I could split to get the filenames for > comparison against an existing filename. > > I have found references to using a callback function as an argument, but > I don't know how this would work, either. >From the ftplib documentation: """The callback function is called for each line, with the trailing CRLF stripped ...""" So, fileList = [] ftp.retrlines('LIST', fileList.append) That should call fileList.append for each line returned by the LIST command, resulting in the list you're interested in. You should be able to do that ftp.dir, too. -Andrew. From David Rock Thu Jun 13 06:48:45 2002 From: David Rock (David Rock) Date: Thu, 13 Jun 2002 00:48:45 -0500 Subject: [python-win32] capturing stdout output from ftplib In-Reply-To: <20020613050100.GA27586@ritsuko.xware.cx>; from andrew-pywin32@puzzling.org on Thu, Jun 13, 2002 at 03:01:00PM +1000 References: <20020612234411.A13646@wdfs.graniteweb.com> <20020613050100.GA27586@ritsuko.xware.cx> Message-ID: <20020613004845.A13895@wdfs.graniteweb.com> On Thu, Jun 13, 2002 at 03:01:00PM +1000, Andrew Bennetts wrote: > >From the ftplib documentation: > """The callback function is called for each line, with the trailing CRLF > stripped ...""" > > So, > > fileList = [] > ftp.retrlines('LIST', fileList.append) > > That should call fileList.append for each line returned by the LIST > command, resulting in the list you're interested in. You should be able > to do that ftp.dir, too. That was it exactly, thanks! -- David Rock david@rock.homelinux.com From terjeja@hotmail.com Thu Jun 13 23:14:37 2002 From: terjeja@hotmail.com (Terje Johan Abrahamsen) Date: Thu, 13 Jun 2002 22:14:37 +0000 Subject: [python-win32] Fwd: [Tutor] Format columns in Excel Message-ID: I am trying to change a column in Excel with Win32Com. So far I have tried this: class chkxl: xlApp = Dispatch("Excel.Application") xlApp.Workbooks.Open("agent.xls") agent = xlApp.Workbooks("agent.xls").Sheets("Sheet1") def __init__(self): chkxl.agent.Columns(10).Style.Name = "number" (There is more to it, so for example chkxl.agent.Cells(2,2).Value = "Hello" works) The style.Name = "number" I found with the helper in Excel. It is supposed to work in VBA, but doesn't seem to work in Python. What would I write to get it to make the column into numbers? Thanks, Terje _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com From ajw126@student.cs.york.ac.uk Mon Jun 17 17:20:14 2002 From: ajw126@student.cs.york.ac.uk (Andrew Wilkinson) Date: Mon, 17 Jun 2002 17:20:14 +0100 Subject: [python-win32] Adding New API functions Message-ID: <005a01c2161a$dd253880$0938fea9@andrewwpc> Hi, I've been trying to write a skinnable win32 application in Python, I recently added some extra functions to the CRgn class which I've submitted to Mark, but I've come across some other api's which are missing and I was wondering how I should add them... The api calls are TransparentBlt and AlphaBlt, I have added them to my own copy of the source and they work fine. I have added them as member functions of the CDC class even though they aren't actually included as part of MFC. Is this an okay thing todo or is Win32all supposed to be an exact copy of the Windows api and MFC classes? In a similar vein I almost crashed my machine when I was creating about 200,000 regions and not calling DeleteObject on them. IMHO Microsoft should have added a simple hRgn != NULL check into MFC, but that ain't never going to happen, so it would make sense to me to add this check to Python wrapper function and greatly reduce the scope for memory leaks. Cheers, Andrew --- Ditch The Decimal System! Lets Use Hex - http://www.intuitor.com/hex/switch.html From mhammond@skippinet.com.au Tue Jun 18 00:26:29 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Tue, 18 Jun 2002 09:26:29 +1000 Subject: [python-win32] Adding New API functions In-Reply-To: <005a01c2161a$dd253880$0938fea9@andrewwpc> Message-ID: > The api calls are TransparentBlt and AlphaBlt, I have added them to my own > copy of the source and they work fine. I have added them as > member functions > of the CDC class even though they aren't actually included as part of MFC. > Is this an okay thing todo or is Win32all supposed to be an exact copy of > the Windows api and MFC classes? I can live with that. However, they may be better in the win32gui module, so it can be used on CE and anywhere else that using the MFC libraries causes pain (if not death) > In a similar vein I almost crashed my machine when I was creating about > 200,000 regions and not calling DeleteObject on them. IMHO > Microsoft should > have added a simple hRgn != NULL check into MFC, but that ain't > never going > to happen, so it would make sense to me to add this check to > Python wrapper > function and greatly reduce the scope for memory leaks. No problem! Mark. From ajw126@student.cs.york.ac.uk Tue Jun 18 15:19:42 2002 From: ajw126@student.cs.york.ac.uk (Andrew Wilkinson) Date: Tue, 18 Jun 2002 15:19:42 +0100 Subject: [python-win32] Adding New API functions References: Message-ID: <007701c216d3$308f8da0$0938fea9@andrewwpc> > > The api calls are TransparentBlt and AlphaBlt, I have added them to my own > > copy of the source and they work fine. I have added them as > > member functions > > of the CDC class even though they aren't actually included as part of MFC. > > Is this an okay thing todo or is Win32all supposed to be an exact copy of > > the Windows api and MFC classes? > > I can live with that. However, they may be better in the win32gui module, > so it can be used on CE and anywhere else that using the MFC libraries > causes pain (if not death) > Those two calls are actually only available on Windows 98/Me and Windows 2000/XP so they can't be used on Windows CE. I guess this could cause a problem if someone tries to use the extension on Windows 95/NT 4. I haven't got a clue what would happen, I guess it would only crash if they tried to execute the call, the rest of the library would work ok. I will add them into the win32gui module as well though. I've just checked on the Microsoft website and these calls have been added to MFC, but I guess that they were added as part of the latest version of MSVC++ as my version (6) doesn't have them in. Andrew From jtucker@clarisay.com Tue Jun 18 15:46:41 2002 From: jtucker@clarisay.com (Jordan Tucker) Date: Tue, 18 Jun 2002 09:46:41 -0500 Subject: [python-win32] activex controls gpf (win32all1.46, wxPython2.3.2.1, python2.2.1) Message-ID: <2DC180789982D311A2C7009027CC78F3374C56@chainsaw.clarisay.com> I'm having a problem with these releases of these awesome software packages... as are a few people it seems. Anyway, here in-house we have been using some ActiveX controls (BeeGrid, Pro-Essentials) to interface with python code. Everything works fine with python 2.0, but now we are trying to upgrade to 2.2 so we can use the nice subclassing of native types, etc. The bug seems to be event-related -- i.e. after events are sent to/from the ax control, any further access becomes invalid, and leads to a GPF (specifically everytime in PyErr_Restore() (at the PY_XDECREF) in errors.c of the pythoncore code). This doesn't happen only with our ax controls -- it happens also with the IE and Acrobat ax demos included with the wxPython 2.3.2.1 demo. We've reproduced it on two machines, a W2K and an NT4 box, both running the same versions of the aforementioned software, except the NT4 box was running Py2.2 and win32all1.42 (I believe). Robin Dunn, the maintainer of wxPython, in a reply to a sourceforge bug message, says he has problems with every new release of win32all, and has trouble debugging it :(. Anyhow, I've tried 1.42, 1.46, and 1.48 on this machine as well, but to no avail. The last version that seemed to work was with build 135, which I am now trying to see if it will compile for Py2.2, but I'm running into problems with SWIG (gives me a syntax error in pywintypes.i on line 56, but it looks harmless enough!). Is it even possible to run 135 with this version of Python, or are there "features" that will break? Just wondering about the feasibility of this plan. Thanks! Jordan From mhammond@skippinet.com.au Wed Jun 19 02:53:09 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Wed, 19 Jun 2002 11:53:09 +1000 Subject: [python-win32] Adding New API functions In-Reply-To: <007701c216d3$308f8da0$0938fea9@andrewwpc> Message-ID: > Those two calls are actually only available on Windows 98/Me and Windows > 2000/XP so they can't be used on Windows CE. I guess this could cause a > problem if someone tries to use the extension on Windows 95/NT 4. > I haven't > got a clue what would happen, I guess it would only crash if they tried to > execute the call, the rest of the library would work ok. > I will add them into the win32gui module as well though. Unfortunately, this really means they must be wrapped up in LoadLibrary/GetProcAddress calls. There are other examples of this in that file. Mark. From mhammond@skippinet.com.au Wed Jun 19 02:57:18 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Wed, 19 Jun 2002 11:57:18 +1000 Subject: [python-win32] activex controls gpf (win32all1.46, wxPython2.3.2.1, python2.2.1) In-Reply-To: <2DC180789982D311A2C7009027CC78F3374C56@chainsaw.clarisay.com> Message-ID: > Anyway, here in-house we have been using some ActiveX controls (BeeGrid, > Pro-Essentials) to interface with python code. Everything works fine with > python 2.0, but now we are trying to upgrade to 2.2 so we can use the nice > subclassing of native types, etc. The bug seems to be > event-related -- i.e. > after events are sent to/from the ax control, any further access becomes > invalid, and leads to a GPF (specifically everytime in PyErr_Restore() (at > the PY_XDECREF) in errors.c of the pythoncore code). Unfortunately, I still haven't got around to making wxPython work here. Look at the Pythonwin OCX demos, and see if you can get pythonwin to fail using these controls. If not, I am afraid I must assume it is in wxPython :( > Py2.2 and win32all1.42 (I believe). Robin Dunn, the maintainer of > wxPython, > in a reply to a sourceforge bug message, says he has problems > with every new > release of win32all, and has trouble debugging it :(. I don't hear about them :( > Anyhow, I've tried 1.42, 1.46, and 1.48 on this machine as well, but to no > avail. The last version that seemed to work was with build 135, which I am > now trying to see if it will compile for Py2.2, but I'm running into > problems with SWIG (gives me a syntax error in pywintypes.i on > line 56, but > it looks harmless enough!). Is it even possible to run 135 with > this version > of Python, or are there "features" that will break? Just > wondering about the > feasibility of this plan. I am afraid I am not really sure what you are asking here. Using SWIG is definately the long route and should be avoided in this case. Mark. From thomas.heller@ion-tof.com Thu Jun 27 14:06:16 2002 From: thomas.heller@ion-tof.com (Thomas Heller) Date: Thu, 27 Jun 2002 15:06:16 +0200 Subject: [python-win32] Straw poll - Python 2.0 and earlier usage References: Message-ID: <02c301c21ddb$6f22f340$e000a8c0@thomasnotebook> > Hi all, > I'm taking a little straw poll here. I am wondering who uses any Python > pre 2.1, and still updates win32all builds. In a nutshell, I am wondering > if anyone would even notice if I never released another win32all update for > pre-Python 2.0 or 1.5.2. > > If you would notice, and feel a little left out in the cold, please mail me. > If no one does, I will try c.l.py I'm still updating, but only to support 1.5.2, 2.0, and 2.1 in py2exe. It may be interesting that IIRC Robin supplies wxPython binaries only for 1.5.2, 2.1, and 2.2 nowadays. No 2.0 anymore. Thomas From mhammond@skippinet.com.au Fri Jun 28 03:33:07 2002 From: mhammond@skippinet.com.au (Mark Hammond) Date: Fri, 28 Jun 2002 12:33:07 +1000 Subject: [python-win32] Straw poll - Python 2.0 and earlier usage In-Reply-To: <02c301c21ddb$6f22f340$e000a8c0@thomasnotebook> Message-ID: > I'm still updating, but only to support 1.5.2, 2.0, and 2.1 in py2exe. Thanks! I got no affirmative personal replies to this mail, so it seems the answer (for this list anyway) is that these early versions are not being updated. > It may be interesting that IIRC Robin supplies wxPython binaries > only for 1.5.2, 2.1, and 2.2 nowadays. No 2.0 anymore. The latest win32all was only 2.1 and 2.2 and I have not yet recieved a complaint/request for other versions. Thanks, Mark.