[python-win32] The VARIANT type is not supported for SAFEARRAYS
Hi, >From a COM object (written in c++) I receive a struct: unsigned shord (2 bytes) BYTE (6 bytes) BYTE (512 bytes) I can use the first two in python, but when I try to acces the last on with python( i.e. test = struct.longbyte), Python stops doing anything and when I debug the code in boa constructor i get the message "The debugger process stopped prematurely." I asked the guy who made the COM object to change the last varibale of the struc to a string, but now the message shown is " The VARIANT type is not supported for SAFEARRAYS" Does anyone knows what's wrong? Kind regards, Gijs -- This message has been scanned for viruses and dangerous content by Network Sentry, and is believed to be clean. http://www.networksentry.co.za ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Office constants
On 6/20/05, Hughes, Chad O <[EMAIL PROTECTED]> wrote: > > > Is there a module that contains all of the constants for office (for > example: xlRight, olOpen, and wdMAPI) in the pywin32 Windows extensions? I > have created my own modules for these constants but I would rather use the > pywin32 extensions if possible. >>> import win32com.client >>> excel = win32com.client.gencache.EnsureDispatch("Excel.Application") >>> win32com.client.constants.xlRight -4152 -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] Forcing win32com.client.dispatch to start up a fresh Excel
Hi, I'm trying to use Python's win32com interface to drive an excel spreadsheet. I've managed to have it open the sheet, call a VBA function with arguments, and close it down cleanly. However, if Excel is already running, it closes the open instance. Which is not good. Is there a way I can do the equivalent of VBA's CreateObject() with win32com? I have purchased "Python Programming on Win32", and can't find anything. Soon I'll be reduced to running a short Perl script to do it, where I'd have Python kick off the Perl to get the job done, but I'd like to avoid that if possible. Thanks very much in advance. Regards, Tom This e-mail, including attachments, is intended for the person(s) or company named and may contain confidential and/or legally privileged information. Unauthorized disclosure, copying or use of this information may be unlawful and is prohibited. If you are not the intended recipient, please delete this message and notify the sender___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Forcing win32com.client.dispatch to start up a freshExcel
[EMAIL PROTECTED] | I'm trying to use Python's win32com interface to drive an excel spreadsheet. | I've managed to have it open the sheet, call a VBA function with arguments, and close it down cleanly. | However, if Excel is already running, it closes the open instance. Which is not good. | Is there a way I can do the equivalent of VBA's CreateObject() with win32com? I have purchased | "Python Programming on | Win32", and can't find anything. I'm not sure about the CreateObject bit, not being a VBA person, but I suspect you may want to use the DispatchEx method rather than simply Dispatch. eg, [some spreadsheet already open] import win32com.client xl = win32com.client.DispatchEx ("Excel.Application") wb = xl.Workbooks.Add () ws = xl.ActiveSheet ws.Cells (1, 1).Value = "Hello" wb.SaveAs ("c:/temp/temp.xls") wb.Close () xl.Quit () xl = None [original spreadsheet still open] TJG This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] (no subject)
Title: Message Folks, I have run into a small problem, that I believe is a Win32net issue... My application has been running (via py2exe) on XP systems without a problem Just recently someone tried to use the application on a Windows 2000 system, and received: * The procedure entry point LsaLookupNames2 cound not be located in the dyanmic link library ADVAPI32.dll. I quickly checked on Google, and found this: http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/83a4f8d5b6dc1b7d/1248f29c226e865a?q=lsalookupnames2+advapi32.dll&rnum=1&hl=en#1248f29c226e865a This looks like the win32net Python extension requires the LsaLookupNames2 function in ADVAPI32, but this is only available in WinXP and Win2003 Server, according to MSDN, preventing to use win32net on win2k. You should report this to Mark Hammond, and maybe use a later version of pywin32 for now. Has anyone else seen this problem? I am running the latest pywin32 (204) for Python 2.4 that I have found 04/19/2005 09:00 AM 3,948,097 pywin32-204.win32-py2.4.exe I may have more information later I have not yet been able to get on to the machine that is causing this problem... But since it doesn't have Python loaded, it maybe difficult to isolate the line, etc that is causing this error I will have to see if Py2exe automatically captured the log... - Ben ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Forcing win32com.client.dispatch to start up a freshExcel
Tim, That worked perfectly. Much obliged. Thanks very much, Tom "Tim Golden" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 06/21/2005 11:52 AM To cc Subject Re: [python-win32] Forcing win32com.client.dispatch to start up a freshExcel [EMAIL PROTECTED] | I'm trying to use Python's win32com interface to drive an excel spreadsheet. | I've managed to have it open the sheet, call a VBA function with arguments, and close it down cleanly. | However, if Excel is already running, it closes the open instance. Which is not good. | Is there a way I can do the equivalent of VBA's CreateObject() with win32com? I have purchased | "Python Programming on | Win32", and can't find anything. I'm not sure about the CreateObject bit, not being a VBA person, but I suspect you may want to use the DispatchEx method rather than simply Dispatch. eg, [some spreadsheet already open] import win32com.client xl = win32com.client.DispatchEx ("Excel.Application") wb = xl.Workbooks.Add () ws = xl.ActiveSheet ws.Cells (1, 1).Value = "Hello" wb.SaveAs ("c:/temp/temp.xls") wb.Close () xl.Quit () xl = None [original spreadsheet still open] TJG This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 This e-mail, including attachments, is intended for the person(s) or company named and may contain confidential and/or legally privileged information. Unauthorized disclosure, copying or use of this information may be unlawful and is prohibited. If you are not the intended recipient, please delete this message and notify the sender___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] GUI analyzer of log file
Hi, all Is there a free reporting tool to generate a graphical report from log file, the format of the log file is similar as Apache log file, something like : 192.168.1.1 - - [06/Jun/2005:09:42:18 -0400] "GET / HTTP/1.1" 200 4779 "http://intranet.sftc/"; "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" If there is no such tool, I am going to use python/Tk, is this a good idea ? Can someone point me a direction ? Best regards, Michael Li ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] (no subject)
"Schollnick, Benjamin" <[EMAIL PROTECTED]> writes: > Folks, > > I have run into a small problem, that I believe is a Win32net > issue... > > My application has been running (via py2exe) on XP systems without > a problem Just recently someone tried to use the application on a > Windows 2000 system, and received: > > * The procedure entry point LsaLookupNames2 cound not be located in the > dyanmic link library ADVAPI32.dll. > > I quickly checked on Google, and found this: ... > > This looks like the win32net Python extension requires the > LsaLookupNames2 function in ADVAPI32, but this is only available in > WinXP and Win2003 Server, according to MSDN, preventing to use > win32net on win2k. You should report this to Mark Hammond, and maybe > use a later version of pywin32 for now. > > Has anyone else seen this problem? > > I am running the latest pywin32 (204) for Python 2.4 that I have > found > > 04/19/2005 09:00 AM 3,948,097 pywin32-204.win32-py2.4.exe > > I may have more information later I have not yet been able to get > on to the machine that is causing this problem... > > But since it doesn't have Python loaded, it maybe difficult to isolate > the line, etc that is causing this error Problems like this can be solved with dependencywalker (google for it). The walker displays binary dependencies for images. Using it I found this: win32net.pyd from build 204 does *not* use the LsaLookupNames2 function in advapi32.dll. However, win32net.pyd links to netapi32.dll (among others), and netapi32.dll links to advapi32.dll, using the name LsaLookupNames2. This was on WinXP. On win2k, netapi32.dll will not link to advapi32's LsaLookupNames2 - otherwise it would not work. So, your exe *should* be able to run on win2k - except if you distribute XP's netapi32.dll with your exe (I've checked this with a trivial py2exe'd script). py2exe isn't very good at determining which dlls belong to the operating system, and so must not be distributed - netapi32.dll is such a beast. You should remove netapi32.dll from the dist directory, and it should work on win2k. And sorry for the false alarm on the threads you mention above ;-) Thomas ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] LsaLookupNames2
> Problems like this can be solved with dependencywalker > (google for it). The walker displays binary dependencies for images. Thankfully dependency issues like this seem to be rare > Using it I found this: win32net.pyd from build 204 does *not* > use the LsaLookupNames2 function in advapi32.dll. However, > win32net.pyd links to netapi32.dll (among others), and > netapi32.dll links to advapi32.dll, using the name > LsaLookupNames2. This was on WinXP. > > On win2k, netapi32.dll will not link to advapi32's > LsaLookupNames2 - otherwise it would not work. > > So, your exe *should* be able to run on win2k - except if you > distribute XP's netapi32.dll with your exe (I've checked this > with a trivial py2exe'd script). I just checked... And guess what... Py2exe is bundling netapi32.dll... I am working on a new beta, so I'll test to see if it will work on XP without netapi32.dll being bundled... If so, then we should be kosher... Good catch... I'll have to grab dependencywalker to get some practice... > py2exe isn't very good at determining which dlls belong to > the operating system, and so must not be distributed - > netapi32.dll is such a beast. You should remove netapi32.dll > from the dist directory, and it should work on win2k. That's what I suspect > And sorry for the false alarm on the threads you mention above ;-) It's okay I just miss McMillian's installer... It's unsupported, so I've moved to py2exe... But McMillian's package seemed to be better with the dependency issues And offered a few features that don't exist in py2exe... (Or at least are not easily handled in py2exe...) On the plus side, py2exe has handled packages lately that I just could not get McMillian's installer to work reliably with... Which is why I switched... Oh well... Progress... - Benjamin ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] LsaLookupNames2
"Schollnick, Benjamin" <[EMAIL PROTECTED]> writes: > It's okay I just miss McMillian's installer... > It's unsupported, so I've moved to py2exe... But > McMillian's package seemed to be better with > the dependency issues And offered a few > features that don't exist in py2exe... (Or at least > are not easily handled in py2exe...) > > On the plus side, py2exe has handled packages lately > that I just could not get McMillian's installer > to work reliably with... Which is why I switched... I always wondered why no one picked up McMillan and continued to develop or at least maintain it - it's open source after all, isn't it? Thomas PS: netapi32.dll is in the list of dlls to exclude in the py2exe cvs version. No date yet for a new release - but you can easily insert it in the current version yourself, the list is in lib/site-packages/py2exe/build_exe.py, should be easy to find. ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] McMillian Installer (Was LsaLookupNames2)
> > It's okay I just miss McMillian's installer... > > It's unsupported, so I've moved to py2exe... But > > McMillian's package seemed to be better with > > the dependency issues And offered a few > > features that don't exist in py2exe... (Or at least > > are not easily handled in py2exe...) > > > > On the plus side, py2exe has handled packages lately > > that I just could not get McMillian's installer > > to work reliably with... Which is why I switched... > > I always wondered why no one picked up McMillan and continued > to develop or at least maintain it - it's open source after > all, isn't it? Yes... It was... In my case, I never was motivated, and I suspect it's got quite complex code behind it... Py2exe is a good replacement... I'm generally happy, there's only a few issues that I have not been able to solve. For example, making a plugin based, expandable, generic build.py If I do, the typlibs that I attempt to import die... Plus right now, I have solved the LsaLookupNames2 issue, but it appears that I need different typelibs between W2000 & WinXp. But here I am on a development XP system, and can't generate the ones for 2000 (Yes this isn't py2exe's fault... But) - Ben ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] McMillian Installer
"Schollnick, Benjamin" <[EMAIL PROTECTED]> writes: >> > It's okay I just miss McMillian's installer... >> > It's unsupported, so I've moved to py2exe... But >> > McMillian's package seemed to be better with >> > the dependency issues And offered a few >> > features that don't exist in py2exe... (Or at least >> > are not easily handled in py2exe...) >> > >> > On the plus side, py2exe has handled packages lately >> > that I just could not get McMillian's installer >> > to work reliably with... Which is why I switched... >> >> I always wondered why no one picked up McMillan and continued >> to develop or at least maintain it - it's open source after >> all, isn't it? > > Yes... It was... > > In my case, I never was motivated, and I suspect it's got > quite complex code behind it... > > Py2exe is a good replacement... I'm generally happy, there's > only a few issues that I have not been able to solve. > > For example, making a plugin based, expandable, generic > build.py If I do, the typlibs that I attempt to import > die... > > Plus right now, I have solved the LsaLookupNames2 issue, but > it appears that I need different typelibs between W2000 & WinXp. > But here I am on a development XP system, and can't generate the > ones for 2000 (Yes this isn't py2exe's fault... But) (Should I change the subject, again, to py2exe ? ;-) We recently had this issue with wmi, which also needs different typelibs on XP and 2K, maybe you can look up the thread. Since Tim was only using the typelib wrapper to access some constants, it was possible to avoid the typelib at all by using some code I posted to find the constants at runtime. The best solution, imo, would be to let the frozen exe create the wrapper at runtime if it is not found in the exe - but this may require some nontrivial pywin32 hacking. Thomas ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Forcing win32com.client.dispatch to start up a fresh Excel
[EMAIL PROTECTED] wrote: > > Hi, > > I'm trying to use Python's win32com interface to drive an excel > spreadsheet. > > I've managed to have it open the sheet, call a VBA function with > arguments, and close it down cleanly. > > However, if Excel is already running, it closes the open instance. > Which is not good. > > Is there a way I can do the equivalent of VBA's CreateObject() with > win32com? If this means "Can I create a totally different independant instance of Excel so that I don't run the risk of stuffing up what the user is doing with their existing instance", then I'd like to know too. ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] manual Install of Python into Windows PE
I'm in the process of wirting some automation tools on top of Windows PE. I would like to start using python instead of windows command shell.. So I'm looking for details on how to manually install python into a windows OS. What I'm starting with is a os image in a folder that eventually get burned to CD. Options that I have looked at that won't work for me are using bartPE and compiling the scripts into executables... Thanks, Blake- ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Forcing win32com.client.dispatch to start up a fresh Excel
John, >> If this means "Can I create a totally different independant instance of >> Excel so that I don't run the risk of stuffing up what the user is doing >> with their existing instance", then I'd like to know too. That's exactly what it is. Actually a bit more complicated than that for me. I'm building a farm of XP boxes to run Excel spreadsheet based models. I have a bit of python to act as a server, reading a message over a socket, calling out to Excel, and returning the result. I expect to be running more than one server on a machine, and hence more than one "instance" of Excel. What Tim proposed worked for me in the simple test I ran (meaning it didn't kill the already-running-instance of excel when I ran it a few times). Soon I'll be doing the more involved thing, with a farm of one. I'll certainly let y'all know if it doesn't work! Thanks, Tom John Machin <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 06/21/2005 04:15 PM To cc python-win32@python.org Subject Re: [python-win32] Forcing win32com.client.dispatch to start up a fresh Excel [EMAIL PROTECTED] wrote: > > Hi, > > I'm trying to use Python's win32com interface to drive an excel > spreadsheet. > > I've managed to have it open the sheet, call a VBA function with > arguments, and close it down cleanly. > > However, if Excel is already running, it closes the open instance. > Which is not good. > > Is there a way I can do the equivalent of VBA's CreateObject() with > win32com? If this means "Can I create a totally different independant instance of Excel so that I don't run the risk of stuffing up what the user is doing with their existing instance", then I'd like to know too. ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 This e-mail, including attachments, is intended for the person(s) or company named and may contain confidential and/or legally privileged information. Unauthorized disclosure, copying or use of this information may be unlawful and is prohibited. If you are not the intended recipient, please delete this message and notify the sender___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
[python-win32] manual Install of Python into Windows PE
I'm in the process of wirting some automation tools on top of Windows PE. I would like to start using python instead of windows command shell.. So I'm looking for details on how to manually install python into a windows OS. What I'm starting with is a os image in a folder that eventually get burned to CD. Options that I have looked at that won't work for me are using bartPE and compiling the scripts into executables... Thanks, Blake- Windows PE info.. http://www.microsoft.com/licensing/programs/sa/support/winpe.mspx ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] Forcing win32com.client.dispatch to start up a fresh Excel
At Tuesday 21/6/2005 17:27, [EMAIL PROTECTED] wrote: >Soon I'll be doing the more involved thing, with a farm of one. I'll >certainly let y'all know if it doesn't work! Might be interesting to know if it *does* work too! Gabriel Genellina Softlab SRL ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32