Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Hammond
On 31/05/2011 6:09 PM, Tim Golden wrote: On 30/05/2011 21:26, Mark Mordeca wrote: Greetings, I would appreciate any help I could get with the following problem. 30% of the time after running the following code to get the sheet names out of an excel file, I will receive a windows error saying th

[python-win32] inserting an image in a word (2003) document

2011-05-31 Thread Stef Mientki
hello, I have word document, with special words like "$$$Name$$$", which are replaced with values from a database. If the special word starts with an underscore, like "$$$_Example$$$", the text should be replaced by an image. I use the code below, which works quit well for texts, but images, jus

Re: [python-win32] Convert RGBA to BGRA using standard library?

2011-05-31 Thread RayS
Something like? >>> a=numpy.array([1,2,3,4,5,6,7,8]) >>> b=a.reshape(2,4).copy() >>> b array([[1, 2, 3, 4],    [5, 6, 7, 8]]) >>> b[:,0]=a.reshape(2,4)[:,2].copy() >>> b[:,2]=a.reshape(2,4)[:,0].copy() >>> b array([[3, 2, 1, 4],    [7, 6, 5, 8]]) See also http://www.mail-archive.com/nump

Re: [python-win32] Convert RGBA to BGRA using standard library?

2011-05-31 Thread Tim Roberts
Greg Ewing wrote: > Can anyone think of an efficient way to convert a string > full of RGBA image data to BGRA, using only what's available > in the standard library? > > I'm trying to add a function to PyGUI for creating an Image > object from arbitrary data. The problem I'm having is that > GDI+

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Mordeca
"Just a couple of quick answers, because I'm dashing off. One is that we have code which uses the technique you're demonstrating to *write* Excel dozens of times a day around the business and I'm not aware of ever having seen the Crash Dialog. Obviously that doesn't necessarily help your case, but

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Tim Golden
On 31/05/2011 16:26, Mark Mordeca wrote: Thanks for your reply Tim. If this is true, I hope to get some advice on how to correct the problem. ... Just a couple of quick answers, because I'm dashing off. One is that we have code which uses the technique you're demonstrating to *write* Excel

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Mordeca
Thanks for your reply Tim. "* I couldn't reproduce the crash after a few times on my Win7 x64 with Office 2003, Python 2.7, pywin32 2.1.4. I note that you said it only crashed 1 time in 3 so perhaps I didn't try hard enough, but there may be some version-sensitivity there as well." I am

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Tim Golden
On 30/05/2011 21:26, Mark Mordeca wrote: Greetings, I would appreciate any help I could get with the following problem. 30% of the time after running the following code to get the sheet names out of an excel file, I will receive a windows error saying that “Microsoft Office Excel has stopped wo