Bingo That Worked. Thanks, Tim On Mon, Mar 17, 2008 at 11:25 PM, <[EMAIL PROTECTED]> wrote:
> Send python-win32 mailing list submissions to > python-win32@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > [EMAIL PROTECTED] > > You can reach the person managing the list at > [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Re: python-win32 Digest, Vol 60, Issue 26 (Tim Golden) > 2. Re: Skip Alt+F4 (le dahut) > 3. Re: Running SQL queries on excel sheets (Rickey, Kyle W) > 4. Re: How to create a com_record? (Kevin Patterson) > 5. Confusion with 'SetForegroundWindow() (Scott Nelson) > 6. python 2.5 (Tarun Kapoor) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 17 Mar 2008 11:51:01 +0000 > From: Tim Golden <[EMAIL PROTECTED]> > Subject: Re: [python-win32] python-win32 Digest, Vol 60, Issue 26 > Cc: python-win32@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > siddhartha veedaluru wrote: > > Hi Tim, > > > > I tried the snippet you sent to me. > > Same error. > > > > i opened the python shell and gave "import wmi" > > It give the same error. > > > > comobj._oleobj_.GetTypeInfo().GetContainingTypeLib()[0].GetTypeComp() > > com_error: (-2147319779, 'Library not registered.', None, None) > > Aha. That's what I wanted to know. (In fact, now I look > at your original post, the same information's shown there. > Shame on me for not checking). > > It *looks* as though one (or more) of the WMI DLLs which in > my system are in c:\windows\system32\wbem need to be reregistered. > It might be something else, however. Can you try running > > regsvr32.exe against the DLLs in (your equivalent of) > c:\windows\system32\wbem? > > I'm sorry this is so involved: I've never encountered someone > with this error before when running WMI. > > TJG > > > ------------------------------ > > Message: 2 > Date: Mon, 17 Mar 2008 14:11:14 +0100 > From: le dahut <[EMAIL PROTECTED]> > Subject: Re: [python-win32] Skip Alt+F4 > To: Paul Moore <[EMAIL PROTECTED]> > Cc: Python-Win32 List <python-win32@python.org> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Oh yes ! That's it. Thank you. > > It is a frame that's used by a service to display some information > before uncancelable forced reboot. > > I now have to determinate how to modify the informations displayed in > the frame. > > Should my program run in the class of the frame ? Or should it get a > sort of handler to the frame and modify the content of a text box ? > I don't know if the second way is possible. > > Paul Moore a ?crit : > > On 17/03/2008, le dahut <[EMAIL PROTECTED]> wrote: > >> I'm writting a Wx app and I want to skip Alt+F4. I've used somehting > >> like that : > >> def OnKeyDown(self, event): > >> print event.AltDown(), event.GetKeyCode() > >> if event.AltDown() and event.GetKeyCode() == wx.WXK_F4: > >> print 'try to close' > >> > >> Everything gets printed but my app closes anyway on Alt+F4, is there a > >> way to skip this ? > > > > (a) you should think hard before doing this - about the only > > reasonable reason for overriding the standard Alt-F4 on Windows, is to > > minimise to the tray rather than closing > > > > (b) if you still want to do this, look at the OnClose event, and > override that. > > > > Paul. > > > > > > > ------------------------------ > > Message: 3 > Date: Mon, 17 Mar 2008 08:40:45 -0500 > From: "Rickey, Kyle W" <[EMAIL PROTECTED]> > Subject: Re: [python-win32] Running SQL queries on excel sheets > To: <python-win32@python.org> > Message-ID: > <[EMAIL PROTECTED] > > > Content-Type: text/plain; charset="us-ascii" > > Thanks John, I'll check that out. > > -Kyle Rickey > > -----Original Message----- > From: John Machin [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 16, 2008 4:40 AM > To: Rickey, Kyle W > Cc: python-win32@python.org > Subject: Re: [python-win32] Running SQL queries on excel sheets > > Rickey, Kyle W wrote: > > Tim, thanks for your response. I've got 7 excel files that need > reading > > containing a total of ~6100 rows. I agree, about this code making me > > sick :) > > That's not exactly "absolutely tons of data" :-) > > One problem with the ODBC approach to reading spreadsheets (at least > with the MS Excel ODBC driver) is that it examines a limited number > (e.g. 8 or 10) of rows to determine what type a column is. So the first > 10 rows have floats in column X then Noddy's managed to get some text in > > cell X11 which is a fatal error for ODBC -- you can't continue. > > [snip] > > > Obviously, all that is only helpful up to a point. Is there some > > reason why you can't just pull the data out straight into Python > > structures and take it from there (or even push it into a Sqlite > > memory database)? Perhaps you've got absolutely tons of data so > > extracting it would be a pain? If not, consider using one of > > the COM packages (win32com.client or comtypes) or something like > > pyExcelerator to pull it out. > > </more helpful> > > Consider the xlrd package (http://www.lexicon.net/sjmachin/xlrd.htm). > It'll tell you what type the data is cell-by-cell -- you can then > compare that with your expectations. > > HTH, > John > > > > > ------------------------------ > > Message: 4 > Date: Mon, 17 Mar 2008 12:18:26 -0400 > From: "Kevin Patterson" <[EMAIL PROTECTED]> > Subject: Re: [python-win32] How to create a com_record? > To: [EMAIL PROTECTED] > Cc: Python-Win32 List <python-win32@python.org> > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > In case it helps, here's the overall description of the COM/app and what > how > this function fits: "COM_App" is a typelib (with multiple classes) for > interfacing to an application that controls hardware on a USB port. When > multiple applications are started it becomes impossible for users to write > code for accessing a particular instance of the app, therefore a manager > com > "COM_Manager" was created. There are two important level of the > COM_Manager. > The first call gets you an object representing the particular application > (Its not really "COM_App" per-se, its just another object that handles > that > app). Then there is "SomeFunction" below, it gives you the particular > class > for the particular COM_App. That is why it is takes a GUID as a parameter. > > I'm still learning about the details of the COM, I guess VT_RECORD is > sort > of the standard way of passing any structure information back and forth? > My > email access for the first half of the week is fairly limited but I'll > still > try to learn my way around the test harness to see if I can create an > example. > > On Sat, Mar 15, 2008 at 12:54 PM, Mark Hammond <[EMAIL PROTECTED]> > wrote: > > > Just to clarify: > > > > > HRESULT SomeFunction( [in] GUID* pGuid, [out, retval, > > iid_is(pGuid)] > > IUnknown** ppUnknown); > > > > > win32com says that it needs a VT_RECORD in order to pass the > GUID > > information > > > to the COM. But from previous email exchanges I can't just deifne some > > GUID > > > > My understanding is that the IDispatch implementation of this method > > declares that it wants a VT_RECORD - which win32com is trying to comply > > with. > > > > When I get back home, my approach will be to simply try and repro the > > issue > > in the win32com test suite, which will at least give me a clearer > picture > > of > > what is happening. If Kevin could take some steps towards this it would > > help. > > > > Cheers, > > > > Mark > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/python-win32/attachments/20080317/a1a03bc2/attachment-0001.htm > > ------------------------------ > > Message: 5 > Date: Mon, 17 Mar 2008 12:09:32 -0500 > From: "Scott Nelson" <[EMAIL PROTECTED]> > Subject: [python-win32] Confusion with 'SetForegroundWindow() > To: python-win32@python.org > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Greets... > > I'm looking to use the win32api and win32gui modules to do a bit of > Windows tinkering (win2k, ActiveState's Python 2.4.1 distribution) and > I've hit a snag. > > I'd like to have my process/window "steal" the focus from whatever > window currently has it, get a bit of input from the keyboard, and > then restore the focus back to the original window. > > In simple cases win32gui.SetForegroundWindow(hwnd) seems to be what > I'm looking for. It works fine when I simply try to set focus to > another window from my app. > > But, I'm seeing unexpected behavior when I go beyond that. I wrote a > simple test script that enumerates through all visible windows and > tries to give each one the focus in turn, after a short delay. It > gets through 1-2 windows out of the 8-10 non-minimized windows I have > open (IE, notepad, wordpad, etc.) and then gives me this: > > Traceback (most recent call last): > File "D:\_code\python\apps\WinTests.py", line 25, in ? > cycle_foreground() > File "D:\_code\python\apps\WinTests.py", line 20, in cycle_foreground > win32gui.SetForegroundWindow(handle) > pywintypes.error: (0, 'SetForegroundWindow', 'No error message is > available') > > What am I doing wrong in this case? Do I have some bad assumptions? > Is my app allowed to "give away" its focus but can't force a different > app's window with focus to "give away" its focus? Is there any other > way to accomplish this? I've attempted using a mix of SetFocus(), > BringWindowToTop(), and EnableWindow() but couldn't find a magic > combo. > > I've attached my test script. Run it as "WinTests cycle" to attempt > to cycle the focus through all top level windows and see the > traceback. Run it as "WinTests 12345" to successfully set the focus > to the window with hwnd of 12345. Run it as "WinTests" to get a list > of all top level window names and their hwnd's. > > I've tried reading the win32 docs provided with ActiveState's > PythonWin, I've read a bit on the win32 API on MSDN and I've googled > around a bit, and haven't found much. > > So, I got curious and tried to code up something similar in C++. It > uses the identical API calls (from what I can tell) and It seems to > have no problem cycling through all the top-level windows. I've > attached my .cpp file as well. > > Why the discrepancy between what I'm seeing with win32gui and c++? > Thoughts? > > -Scott > -------------- next part -------------- > An embedded and charset-unspecified text was scrubbed... > Name: SetForegroundWindow.cpp > Url: > http://mail.python.org/pipermail/python-win32/attachments/20080317/b29565b5/attachment-0002.txt > -------------- next part -------------- > An embedded and charset-unspecified text was scrubbed... > Name: WinTests.py > Url: > http://mail.python.org/pipermail/python-win32/attachments/20080317/b29565b5/attachment-0003.txt > > ------------------------------ > > Message: 6 > Date: Mon, 17 Mar 2008 12:53:23 -0500 > From: "Tarun Kapoor" <[EMAIL PROTECTED]> > Subject: [python-win32] python 2.5 > To: <python-win32@python.org> > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii" > > I want to use python win32 extensions on python 2.5 but it seems like > they were built for 2.3... > > I copied the win32 folders from C:\python23\lib\site-packages to > C:\python25\lib\site-packages but it does not work.... > > Is there a workaround ? anyone using it ? > > -TK > > > > Disclaimer > > This e-mail and any attachments is confidential and intended solely for > the use of the individual(s) to whom it is addressed. Any views or opinions > presented are solely those of the author and do not necessarily represent > those of Waterstone Capital Management, L.P and affiliates. If you are not > the intended recipient, be advised that you have received this e-mail in > error and that any use, dissemination, printing, forwarding or copying of > this email is strictly prohibited. Please contact the sender if you have > received this e-mail in error. You should also be aware that e-mails are > susceptible to interference and you should not assume that the contents of > this e-mail originated from the sender above or that they have been > accurately reproduced in their original form. Waterstone Capital Management, > L.P. and affiliates accepts no responsibility for information, or errors > or omissions in this e-mail or use or misuse thereof. If in doubt, please > verify the authenticity with the! > sender. > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/python-win32/attachments/20080317/82b9be5d/attachment.htm > > ------------------------------ > > _______________________________________________ > python-win32 mailing list > python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of python-win32 Digest, Vol 60, Issue 28 > ******************************************** >
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32