From tony at tcapp.com Sun Feb 1 02:20:33 2004 From: tony at tcapp.com (Tony Cappellini) Date: Sun Feb 1 02:20:49 2004 Subject: [python-win32] fake imports ? Message-ID: <6.0.0.22.0.20040131230753.01eb6148@smtp.sbcglobal.net> I've written some python functions that I use whenever I'm in the interactive interpreter, so I want them automatically imported an available whenever I run interactively.. These are imported by site.py try: import sitecustomize except ImportError: pass sitecustomize.py contains only this (for now) try: import mymods except ImportError: pass After PythonWin is launched- I wanted to verify that mymods actually got loaded so I type mymods. and the popup list shows the functions I've defined in mymods.py (this implies the import was successfull) However, when I try calling one of these functions as in mymods.somefunc() NameError: mymods is not defined So I tried the same thing with the os module (mymods.py imports the os module) os. the popup list shows attributes of the os module that are available however, when I try to invoke os.getcwd() NameError: os is not defined I don't understand why the popuplist with the module attributes is displayed, if the name hasn't been imported into PythonWin's namespace Would someone explain this ? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040131/b48ca2eb/attachment.html From bgailer at alum.rpi.edu Sun Feb 1 09:48:52 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Sun Feb 1 09:48:56 2004 Subject: [python-win32] Problem with PythonWin IDE child windows odd behavior. In-Reply-To: <5.2.0.4.0.20040129134420.01e71ab8@blue-cove.com> References: <5.2.0.4.0.20040129134420.01e71ab8@blue-cove.com> Message-ID: <6.0.0.22.0.20040201074341.02cc7ce8@mail.mric.net> On my Win 2003 Server I can open 8 PythonWin IDE child windows without problem. Any windows I open beyond that become transparent, showing whatever was active just before selecting it. The problem jointly affects child windows in Mozilla. Child windows in MS Excel and Access and IE are not affected. What might cause this? Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell -------------- next part -------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004 From amonroe at columbus.rr.com Sun Feb 1 10:03:14 2004 From: amonroe at columbus.rr.com (R. Alan Monroe) Date: Sun Feb 1 09:58:51 2004 Subject: [python-win32] Problem with PythonWin IDE child windows odd behavior. In-Reply-To: <6.0.0.22.0.20040201074341.02cc7ce8@mail.mric.net> References: <5.2.0.4.0.20040129134420.01e71ab8@blue-cove.com> <6.0.0.22.0.20040201074341.02cc7ce8@mail.mric.net> Message-ID: <96212414706.20040201100314@columbus.rr.com> > On my Win 2003 Server I can open 8 PythonWin IDE child windows without > problem. Any windows I open beyond that become transparent, showing > whatever was active just before selecting it. > The problem jointly affects child windows in Mozilla. > Child windows in MS Excel and Access and IE are not affected. > What might cause this? Go into task manager. Go to the processes tab. On the menu go to View/Select columns. Check on "USER objects" and "GDI objects". The GDI count is probably really high for those apps. I personally experienced that if Mozilla 1.5 got over 1000 GDI object it would quit refreshing its own screen. I haven't got to test that with 1.6 yet. As far as I know you'll just have to exit & relaunch, and report it as a resource leak to the program authors. Alan From karthik19_20 at yahoo.com Mon Feb 2 07:03:33 2004 From: karthik19_20 at yahoo.com (karthik karthik) Date: Mon Feb 2 07:03:37 2004 Subject: [python-win32] help needed to get properties of windows gui controls Message-ID: <20040202120333.52577.qmail@web11905.mail.yahoo.com> hi! i'm developing Test Automation Framework and i need to display the different properties of selected controls like textboxes, buttons, comboboxes etc. say for example, if it is a list box: the user selected 3 list items out of 5 list items i've to display the selected items and total items. like wise, selected text, default button text for a dialog box... pyAA is supporting only limited properties. how can i do these using win32 api calls??? ===== thanks and regards, Karthik. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ From ramki at indexcal.com Sun Feb 1 23:42:43 2004 From: ramki at indexcal.com (ramki@indexcal.com) Date: Mon Feb 2 12:19:22 2004 Subject: [python-win32] Using wxpython window as delpi child windows Message-ID: <1075696963.401dd543bdf16@webmail.indexcal.com> Hi I am using Delphi IV with python 2.3.3, win32all build 163,wxPythonWIN32-2.4.2.4-Py23. I would like to seamlessly use windows generated in python and Delphi windows. How do i use python windows as Delphi child window. Currently wxapp behaves as a separate application. Any suggestion will be highly appreciated regds Ramki From bjorn.x.hellstrom at se.abb.com Mon Feb 2 13:40:23 2004 From: bjorn.x.hellstrom at se.abb.com (bjorn.x.hellstrom@se.abb.com) Date: Mon Feb 2 13:47:00 2004 Subject: [python-win32] Problem with "stacksize" for Python Com servers Message-ID: Hello, I have used Python now for a couple of month with greate success for "Python(command line)" and for Pythonwin. My application (my.dll) needs more than 1 MB in stacksize, so I had to recompile and reload pythoncore(python23.dll), python(python.exe) and pythonw(pythonw.exe). I have set "Stack Reserve Size" equal to 100 MB, same for "Stack Commit Size". I'm using Python version 2.3.2, win32all-163, Microsoft .NET, Excel 2002 on a PC with Windows XP servicepack 1. When using Python COM servers, I can run my application in Excel, but only for "small" problems (stacksize < 1MB) When I have my normal application, Excel crash, as python and pythonwin did before I increased the stacksize. How to increase stacksize for COM applications? My example is similar to Example 15-14 in the book "Programming Python, 2nd Edition, O?Reilly", except that I import my application before defining "class MyServer:". Mbr / Bj?rn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040202/c6839c9e/attachment.html From Paul.Weimer at harlandfs.com Mon Feb 2 17:53:16 2004 From: Paul.Weimer at harlandfs.com (Paul Weimer) Date: Mon Feb 2 17:56:28 2004 Subject: [python-win32] Where can I find the Win32 extensions source or debug versions? Message-ID: <342DB6B3FE8BD5119D0F0090273C23649C5514@ex_portland1.harlandfs.com> I'm sure I've looked right at them but something in my brain isn't working. Thanks From bgailer at alum.rpi.edu Mon Feb 2 18:06:35 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Mon Feb 2 18:19:55 2004 Subject: [python-win32] Problem with PythonWin IDE child windows odd behavior. In-Reply-To: <96212414706.20040201100314@columbus.rr.com> References: <5.2.0.4.0.20040129134420.01e71ab8@blue-cove.com> <6.0.0.22.0.20040201074341.02cc7ce8@mail.mric.net> <96212414706.20040201100314@columbus.rr.com> Message-ID: <6.0.0.22.0.20040202160159.02815ae0@mail.mric.net> At 08:03 AM 2/1/2004, R. Alan Monroe wrote: > > On my Win 2003 Server I can open 8 PythonWin IDE child windows without > > problem. Any windows I open beyond that become transparent, showing > > whatever was active just before selecting it. > > > The problem jointly affects child windows in Mozilla. > > > Child windows in MS Excel and Access and IE are not affected. > > > What might cause this? > >Go into task manager. Go to the processes tab. On the menu go to >View/Select columns. Check on "USER objects" and "GDI objects". The >GDI count is probably really high for those apps. I personally >experienced that if Mozilla 1.5 got over 1000 GDI object it would quit >refreshing its own screen. Opening 12 windows in PythonWin (4 unusable due to problem) USER objects = 235 GDI objects = 279. Mozilla by itself does not have the problem (as far as I can tell). But with PythonWin running enough windows Mozilla then fails. PythonWin seems to be the culprit. >I haven't got to test that with 1.6 yet. As >far as I know you'll just have to exit & relaunch, and report it as a >resource leak to the program authors. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell -------------- next part -------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004 From andy at clearwind.ca Mon Feb 2 18:09:13 2004 From: andy at clearwind.ca (Andy McKay) Date: Mon Feb 2 18:21:25 2004 Subject: [python-win32] Where can I find the Win32 extensions source or debug versions? In-Reply-To: <342DB6B3FE8BD5119D0F0090273C23649C5514@ex_portland1.harlandfs.com> References: <342DB6B3FE8BD5119D0F0090273C23649C5514@ex_portland1.harlandfs.com> Message-ID: <401ED899.2090307@clearwind.ca> Paul Weimer wrote: > I'm sure I've looked right at them but something in my brain isn't working. http://starship.python.net/crew/mhammond/win32/Downloads.html ? -- Andy McKay ClearWind Consulting http://www.clearwind.ca From amonroe at columbus.rr.com Mon Feb 2 18:47:31 2004 From: amonroe at columbus.rr.com (R. Alan Monroe) Date: Mon Feb 2 18:42:58 2004 Subject: [python-win32] Problem with PythonWin IDE child windows odd behavior. In-Reply-To: <6.0.0.22.0.20040202160159.02815ae0@mail.mric.net> References: <5.2.0.4.0.20040129134420.01e71ab8@blue-cove.com> <6.0.0.22.0.20040201074341.02cc7ce8@mail.mric.net> <96212414706.20040201100314@columbus.rr.com> <6.0.0.22.0.20040202160159.02815ae0@mail.mric.net> Message-ID: <101330272426.20040202184731@columbus.rr.com> >>Go into task manager. Go to the processes tab. On the menu go to >>View/Select columns. Check on "USER objects" and "GDI objects". The >>GDI count is probably really high for those apps. I personally >>experienced that if Mozilla 1.5 got over 1000 GDI object it would quit >>refreshing its own screen. > Opening 12 windows in PythonWin (4 unusable due to problem) USER objects = > 235 GDI objects = 279. > Mozilla by itself does not have the problem (as far as I can tell). But > with PythonWin running enough windows Mozilla then fails. > PythonWin seems to be the culprit. >>I haven't got to test that with 1.6 yet. As >>far as I know you'll just have to exit & relaunch, and report it as a >>resource leak to the program authors. Grasping at straws... a video driver problem? Let us know if you find some definitive way of diagnosing this one. Alan From niki at vintech.bg Tue Feb 3 04:57:47 2004 From: niki at vintech.bg (Niki Spahiev) Date: Tue Feb 3 05:03:58 2004 Subject: [python-win32] Problem with "stacksize" for Python Com servers In-Reply-To: References: Message-ID: <401F709B.1070201@vintech.bg> bjorn.x.hellstrom@se.abb.com wrote: > > Hello, > I have used Python now for a couple of month with greate success for > "Python(command line)" and for Pythonwin. > My application (my.dll) needs more than 1 MB in stacksize, so I had to > recompile and reload pythoncore(python23.dll), python(python.exe) and > pythonw(pythonw.exe). > I have set "Stack Reserve Size" equal to 100 MB, same for "Stack Commit > Size". > > I'm using Python version 2.3.2, win32all-163, Microsoft .NET, Excel 2002 > on a PC with Windows XP servicepack 1. > > When using Python COM servers, I can run my application in Excel, but > only for "small" problems (stacksize < 1MB) > When I have my normal application, Excel crash, as python and pythonwin > did before I increased the stacksize. > > *How to increase stacksize for COM applications?* > Try out of precess (EXE) COM server. Niki Spahiev From michel.belanger at seidel.ca Wed Feb 4 19:33:13 2004 From: michel.belanger at seidel.ca (=?ISO-8859-1?Q?Michel_B=E9langer?=) Date: Wed Feb 4 19:33:21 2004 Subject: [python-win32] Executable file version in windows Message-ID: <40218F49.8000707@seidel.ca> Hi, How can I query a file executable (exe, dll, com)for its version including the revision, i.e. exemple: >>>queryVersion("someprog.exe") 5.1.2 Many thanks Michel Belanger From Richard.Martin at thomson.net Wed Feb 4 19:45:20 2004 From: Richard.Martin at thomson.net (Martin Richard) Date: Wed Feb 4 19:45:38 2004 Subject: [python-win32] Executable file version in windows Message-ID: <3531F1FE12C5B4489D2014F59B4669130F7CAB@bvtnsmail01.am.thmulti.com> A hack that requires filever.exe from the NT resource kit. filever returns a human readable output that the code reads via a pipe; then it gets substrings and does pattern matches to get the appropriate information. It depends on developers putting the version string in a location where filever can get it. Rick def getFileVerInfo(fullFilePath, verbose=0): ''' Uses FileVer to get file information. Args: fullFilePath: should be a path reachable from the current directory Returns: a tuple of strings for the value of the ProductVersion and the value of FileVersion ''' pipe = 0 inputLine = 'not blank' productVersionPattern = re.compile("\W*ProductVersion\W*(\S*)", re.I) fileVersionPattern = re.compile("\W*FileVersion\W*(\S*)", re.I) noFileVerPattern = re.compile("not recognized", re.I) dirPattern = re.compile('-----') productVersionString = '' fileVersionString = '' if verbose: print fullFilePath try: # need to quote the path name to handle filenames with spaces pipe = os.popen ('.\\filever.exe /v "%s"' % fullFilePath) # fileInfo will be a list of lines from the output of filever fileInfo = pipe.readlines() pipe.close() except: traceback.print_exc() raise "Could not run filever. Make sure it is on your path" # look for size and date from first line try: fileDate = fileInfo[0][50:60] except: fileDate = 'unknown' try: fileSize = fileInfo[0][39:49] except: fileSize = 'unknown' # look for product and file version strings in the reminder of the # output from filever.exe for line in fileInfo[1:]: match = productVersionPattern.search(line) if match: productVersionString = match.group(1) match = fileVersionPattern.search(line) if match: fileVersionString = match.group(1) return (fileDate, fileSize, productVersionString, fileVersionString) -----Original Message----- From: Michel B?langer [mailto:michel.belanger@seidel.ca] Sent: Wednesday, February 04, 2004 4:33 PM To: python-win32@python.org Subject: [python-win32] Executable file version in windows Hi, How can I query a file executable (exe, dll, com)for its version including the revision, i.e. exemple: >>>queryVersion("someprog.exe") 5.1.2 Many thanks Michel Belanger _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 From tim.golden at viacom-outdoor.co.uk Thu Feb 5 03:30:38 2004 From: tim.golden at viacom-outdoor.co.uk (Tim Golden) Date: Thu Feb 5 03:38:58 2004 Subject: [python-win32] Executable file version in windows Message-ID: >From: Michel B?langer [mailto:michel.belanger@seidel.ca] > >How can I query a file executable (exe, dll, com)for its version >including the revision, i.e. > >exemple: > >>>queryVersion("someprog.exe") >5.1.2 > Have a look at this: http://groups.google.com/groups?q=file+version+wmi+group:comp.lang.python.*& group=comp.lang.python.*&selm=8360efcd.0308290048.2d88d5d%40posting.google.c om&rnum=5 (If that url gets broken, Google in c.l.py for "win32 file attributes") TJG ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. 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 ________________________________________________________________________ From tim.golden at viacom-outdoor.co.uk Thu Feb 5 10:23:27 2004 From: tim.golden at viacom-outdoor.co.uk (Tim Golden) Date: Thu Feb 5 10:31:45 2004 Subject: [python-win32] win32security.SID - System Error Message-ID: I am -- occasionally and slightly unpredictably -- getting a SystemError when I try to instantiate a win32security.SID object using the standard __init__. Example: ActivePython 2.2.3 Build 227 (ActiveState Corp.) based on Python 2.2.3 (#42, Nov 13 2003, 09:57:55) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import win32security >>> s = win32security.SID ((0, 0, 0, 0, 0, 5), (21, 1511986248)) >>> print s SystemError: D:\trentm\as\Apps\ActivePython-2_2\src\Core\Objects\longobject.c:231: bad argument to internal function >>> There's obviously something wrong, because -- even if I provided slightly dodgy parameters -- I should just get a conventional Exception. I've had a look on Sourceforge and can't see a known bug which seems to describe this, but while I forage for my (seldom used) Sourceforge id to log a new one, has anyone any light to shed? Extra information: I can happily use PySIDs generated from the other win32security functions, such as LookupAccountName and ConvertStringSidToSid TJG ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. 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 ________________________________________________________________________ From bgailer at alum.rpi.edu Thu Feb 5 11:54:01 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Thu Feb 5 11:54:07 2004 Subject: [python-win32] win32ui: The profile settings have already been loaded. Vers 160 also. Message-ID: <6.0.0.22.0.20040205095309.031652b8@mail.mric.net> I ran into this error on a client's machine months ago and reported it. Now I installed win32all 162 on my box and get the same problem. Any ideas? Version 160 has same problem. How far back do I have to go to get a working version? Press F5 or F10 to start debugging and get Traceback (most recent call last): File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 305, in RunScript debugger.run(codeObject, __main__.__dict__, start_stepping=1) File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 60, in run _GetCurrentDebugger().run(cmd, globals,locals, start_stepping) File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 35, in _GetCurrentDebugger _CheckNeedGUI() File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 21, in _CheckNeedGUI pywin.framework.app.CreateDefaultGUI(dbgpyapp.DebuggerPythonApp) File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\framework\app.py", line 392, in CreateDefaultGUI appClass().InitInstance() File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\dbgpyapp.py", line 33, in InitInstance win32ui.LoadStdProfileSettings(numMRU) win32ui: The profile settings have already been loaded. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell -------------- next part -------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 From bgailer at alum.rpi.edu Thu Feb 5 11:49:06 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Thu Feb 5 11:54:27 2004 Subject: [python-win32] win32ui: The profile settings have already been loaded. In-Reply-To: <3FC80D4C.5050508@hotpop.com> References: <3FC80D4C.5050508@hotpop.com> Message-ID: <6.0.0.22.0.20040205094644.031668f8@mail.mric.net> I ran into this error on a client's machine months ago and reported it. Now I installed win32all 162 on my box and get the same problem. Any ideas? Press F5 or F10 to start debugging and get Traceback (most recent call last): File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 305, in RunScript debugger.run(codeObject, __main__.__dict__, start_stepping=1) File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 60, in run _GetCurrentDebugger().run(cmd, globals,locals, start_stepping) File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 35, in _GetCurrentDebugger _CheckNeedGUI() File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 21, in _CheckNeedGUI pywin.framework.app.CreateDefaultGUI(dbgpyapp.DebuggerPythonApp) File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\framework\app.py", line 392, in CreateDefaultGUI appClass().InitInstance() File "P:\PYTHON22\lib\site-packages\Pythonwin\pywin\debugger\dbgpyapp.py", line 33, in InitInstance win32ui.LoadStdProfileSettings(numMRU) win32ui: The profile settings have already been loaded. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell -------------- next part -------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 From bgailer at alum.rpi.edu Thu Feb 5 12:12:37 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Thu Feb 5 12:47:17 2004 Subject: [python-win32] I am really screwed now. Message-ID: <6.0.0.22.0.20040205100512.0314dbb8@mail.mric.net> I tried going back in versions, all the way to 154, which I was using successfully. In the process of installing 158, 156, and 154 I got installation errors about not finding an entry point in a dll. Now even version 154 does not work in the debugger. Can someone help? I have clients waiting for revised programs and I am dead in the water! Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell -------------- next part -------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 From Christian.Wyglendowski at greenville.edu Thu Feb 5 13:05:56 2004 From: Christian.Wyglendowski at greenville.edu (Christian Wyglendowski) Date: Thu Feb 5 13:06:01 2004 Subject: [python-win32] Executable file version in windows Message-ID: > -----Original Message----- > How can I query a file executable (exe, dll, com)for its version > including the revision, i.e. > > exemple: > >>>queryVersion("someprog.exe") > 5.1.2 Here is another way: >>> from win32com.client import Dispatch >>> fso = Dispatch('Scripting.FileSystemObject') >>> fso.GetFileVersion(r'c:\windows\system32\cacls.exe') u'5.1.2600.0' >>> fso.GetFileVersion(r'c:\windows\system32\ntdll.dll') u'5.1.2600.1217' > Many thanks You're welcome! Christian http://www.dowski.com From dpelletier1991 at yahoo.com Thu Feb 5 15:06:21 2004 From: dpelletier1991 at yahoo.com (Don Pelletier) Date: Thu Feb 5 15:06:25 2004 Subject: [python-win32] Install error for win32all163: AXScript... 'module' object has no attribute 'import_pywin32_system_module__' Message-ID: <20040205200621.29419.qmail@web40403.mail.yahoo.com> Hi, just wanted to say awesome job for all the win32 contributions to the python community!!! ..and also ask if you knew about this installation problem: (I just installed python 233final on my windows 2000 machine. It previously had py232 with the previous version of win32all). I noticed that there was an instance of python running, so using pview, I yanked it from memory and also found and registered an earlier version of comcat.dll (4.71 I believe). Then I ran the install of win32 package and recieved this error (plus the usual two others after this- registration of the Python interpreter COM server failed + Registration of the Python Dictionary COM server failed... ImportError: cannot import name DISPATCH_METHOD): Registration of the AXScript Engine COM server failed. Installation will continue, but this will require manual registration before it will function exceptions.AttributeError: 'module' object has no attribute 'import_pywin32_system_module__' -thanks in advance From parente at cs.unc.edu Thu Feb 5 15:49:42 2004 From: parente at cs.unc.edu (Peter Parente) Date: Thu Feb 5 17:36:29 2004 Subject: [python-win32] Persistent COM server? (GetObject?) Message-ID: <4022AC66.2010204@cs.unc.edu> Is it possible to create a COM server in Python that persists even after the client that created it has finished using it and ends? For instance, I want to allow a COM client to instantiate my COM server if it is not already running. When that client finishes working with the COM server, I want the server to persist and wait around for the next client to contact it. The server never needs to quit. To me, this sounds a lot like using the GetObject function for COM. The client calls GetObject and passes the function the name of the server class. If the server is running, an instance to that server is returned. If the server is not running, it is started and an instance is returned. Is it possible to use GetObject to retrieve a reference to or start a Python COM server? Would this give me a persistent COM server that would exist past the lifetime of a client using it? Thanks, Peter Parente From tony at tcapp.com Fri Feb 6 01:56:12 2004 From: tony at tcapp.com (Tony Cappellini) Date: Fri Feb 6 01:56:23 2004 Subject: [python-win32] re:Using wxpython window as delpi child windows Message-ID: <6.0.0.22.0.20040205225430.01e75658@smtp.sbcglobal.net> Search for Python For Delphi. There are python extensions for Delphi. I'm niot sure if this will help you directly with Wx, but It may give you other ideas Tony Message: 1 Date: Mon, 2 Feb 2004 10:12:43 +0530 From: ramki@indexcal.com Subject: [python-win32] Using wxpython window as delpi child windows To: python-win32@python.org Message-ID: <1075696963.401dd543bdf16@webmail.indexcal.com> Content-Type: text/plain; charset=ISO-8859-1 Hi I am using Delphi IV with python 2.3.3, win32all build 163,wxPythonWIN32-2.4.2.4-Py23. I would like to seamlessly use windows generated in python and Delphi windows. How do i use python windows as Delphi child window. Currently wxapp behaves as a separate application. Any suggestion will be highly appreciated regds Ramki From spencer at efn.org Fri Feb 6 16:58:33 2004 From: spencer at efn.org (spencer@efn.org) Date: Fri Feb 6 16:58:37 2004 Subject: [python-win32] (no subject) Message-ID: <1076104713.40240e093b804@webmail.efn.org> Here's an old question that must have been answered by private email, because I can't find the answer anywhere. I literally copied/pasted this, because it's exactly my question. It's about the example on page 69 of "Python Programming on Win32": I was trying to get the second part of the example from Chapter 5 of "Python programming on win32" to work. It is a simple COM server. The code is: class PythonUtilities: _public_methods_ = [ 'SplitString' ] _reg_progid_ = "PythonDemos.Utilities" _reg_clsid_ = "{41B329A0-14D2-498B-9F49-55B7203BE0E7}" def SplitString(self, val, item=None): import string if item != None : item = str(item) return string.split(str(val),item) if __name__ == '__main__': print "Registering COM" import win32com.server.register win32com.server.register.UseCommandLine(PythonUtilities) The class id was obtained by doing >>> print pythoncom.CreateGuid() Now when I execute this I get the following message >>> Registering COM Warning: Can not locate a host .EXE for the COM server The server will not be registered with LocalServer32 support.Registered: PythonDemos.Utilities Can anyone explain what might have gone wrong? Thanks Spencer Doidge From spencer at efn.org Fri Feb 6 16:59:51 2004 From: spencer at efn.org (spencer@efn.org) Date: Fri Feb 6 16:59:55 2004 Subject: [python-win32] win32com.server.register -- an old question Message-ID: <1076104791.40240e57d4b90@webmail.efn.org> Here's an old question that must have been answered by private email, because I can't find the answer anywhere. I literally copied/pasted this, because it's exactly my question. It's about the example on page 69 of "Python Programming on Win32": I was trying to get the second part of the example from Chapter 5 of "Python programming on win32" to work. It is a simple COM server. The code is: class PythonUtilities: _public_methods_ = [ 'SplitString' ] _reg_progid_ = "PythonDemos.Utilities" _reg_clsid_ = "{41B329A0-14D2-498B-9F49-55B7203BE0E7}" def SplitString(self, val, item=None): import string if item != None : item = str(item) return string.split(str(val),item) if __name__ == '__main__': print "Registering COM" import win32com.server.register win32com.server.register.UseCommandLine(PythonUtilities) The class id was obtained by doing >>> print pythoncom.CreateGuid() Now when I execute this I get the following message >>> Registering COM Warning: Can not locate a host .EXE for the COM server The server will not be registered with LocalServer32 support.Registered: PythonDemos.Utilities Can anyone explain what might have gone wrong? Thanks Spencer Doidge with aplogies for multiple erroneous sendings of this message. From isrgish at fusemail.com Mon Feb 9 23:23:00 2004 From: isrgish at fusemail.com (Isr Gish) Date: Mon Feb 9 23:22:53 2004 Subject: [python-win32] Problems with _winreg On WinCE Message-ID: I'm running python on a Pocket PC. I have tried posting to the PythonCE group. But I got no answer. I tried using the _winreg module but couldn't get anything to work there also I couldn't understand the error messages. Here is what I tried and the results: >>> k = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, None) worked fine >>> testkey = _winreg.OpenKey(k, "Test") Traceback (most recent call last): File "\Program Files\Python\pcceshell\interact.py", line 58, in Interact exec codeOb in locals WindowsError: [Errno 2] T There is a subkey named Test but I cant figure ootswhat the problem is and the error message doesn't help much. See below >>> newkey = _winreg.CreateKey(k, "Test") This seemed to work but when I looked in the registry I found a key with for boxes (????). >>> enumkeys = _winreg.EnumKey(k, 0) Traceback (most recent call last): File "\Program Files\Python\pcceshell\interact.py", line 58, in Interact exec codeOb in locals WindowsError: [Errno 87] T >>> enumkeys = _winreg.EnumKey(k, 1) Traceback (most recent call last): File "\Program Files\Python\pcceshell\interact.py", line 58, in Interact exec codeOb in locals WindowsError: [Errno 87] T I cant figure out from the error what is wrong. Please help, any and all help wold be greatly appreciated. All the best, Isr Gish From karthik19_20 at yahoo.com Tue Feb 10 03:55:27 2004 From: karthik19_20 at yahoo.com (karthik karthik) Date: Tue Feb 10 03:55:30 2004 Subject: [python-win32] help needed. Message-ID: <20040210085527.72499.qmail@web11908.mail.yahoo.com> hi! i'm unable to find the default action for a window. say, for 'font dialog box' of notepad, the default action is "OK". just i need to get the string 'ok' can anyone give a solution please? ===== thanks and regards, Karthik. __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From karthik19_20 at yahoo.com Tue Feb 10 04:09:56 2004 From: karthik19_20 at yahoo.com (karthik karthik) Date: Tue Feb 10 04:10:06 2004 Subject: [python-win32] how can i find the index of a control? Message-ID: <20040210090956.78706.qmail@web11905.mail.yahoo.com> hi! i scanned a window say, 'Find' dialog box of notepad, i am able to access all the controls of the 'Find' dialog using the Accessible object of pyAA. suppose, the treeview looks like this: Find(window) NAMELESS(titlebar) IME(push button) Minimize(push button) Maximize(push button) Context help(push button) Close(push button) now, if i loop through the accessible object of the find(window), i'm able to access the names, description, location of each control. i want to get the index of each control meaning, index of IME is 1 index of Minimize is 2 index of Maximize is 3 index of Context help is 4 index of Close is 5 i'm unable to do this. is there any way to get this either using pyAA or win32? ===== thanks and regards, Karthik. __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html From rwupole at msn.com Thu Feb 12 00:37:45 2004 From: rwupole at msn.com (Roger Upole) Date: Wed Feb 11 21:21:26 2004 Subject: [python-win32] win32security.SID - System Error Message-ID: <000a01c3f12a$595048a0$ce2af243@rupole> It appears that the manual constructor is assuming that the sub-authorities are going to be Long objects, and not doing any type-checking or error checking, leaving an exception hanging. You can trigger the same behaviour with win32security.SID ((0, 0, 0, 0, 0, 5), ('x','y')) Looks like for a workaround, you can use win32security.SID ((0, 0, 0, 0, 0, 5), (long(21), long(1511986248))) Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040211/c231a00a/attachment.html From rwupole at msn.com Thu Feb 12 01:08:23 2004 From: rwupole at msn.com (Roger Upole) Date: Wed Feb 11 21:52:02 2004 Subject: [python-win32] Executable file version in windows Message-ID: <001501c3f12e$a05a54d0$ce2af243@rupole> GetFileVersionInfo is now in win32api. Check out \demos\getfilever.py for an example of how to use it. Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040211/b0e29d9b/attachment.html From tim.golden at viacom-outdoor.co.uk Thu Feb 12 03:56:55 2004 From: tim.golden at viacom-outdoor.co.uk (Tim Golden) Date: Thu Feb 12 03:57:02 2004 Subject: [python-win32] win32security.SID - System Error Message-ID: From: Roger Upole [mailto:rwupole@msn.com] >> It appears that the manual constructor is assuming that >> the sub-authorities are going to be Long objects, and not >> doing any type-checking or error checking, leaving an >> exception hanging. >> Looks like for a workaround, you can use >> win32security.SID ((0, 0, 0, 0, 0, 5), (long(21), long(1511986248))) >> Roger Exactly what I needed to know. Thanks very much. Tim ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. 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 ________________________________________________________________________ From michel.belanger at seidel.ca Thu Feb 12 19:51:46 2004 From: michel.belanger at seidel.ca (=?ISO-8859-1?Q?Michel_B=E9langer?=) Date: Thu Feb 12 19:51:53 2004 Subject: [python-win32] how to open DAO file with password Message-ID: <402C1FA2.6080702@seidel.ca> Hi all, I want to open a mdb file with the DAO 35 or 36. I am ok to open the file if it does not have a password. However OpenDatabase failed if the file is protected by a password. Here is what I have: import win32com.client engine = win32com.client.Dispatch("DAO.DBEngine.35") db = engine.OpenDatabase(r"config.per", Options='sorbier') I thought that the Options equal the password would do, but it did not. What do you suggest? Michel Belanger From jkreps at rev.state.ne.us Fri Feb 13 12:33:18 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Fri Feb 13 12:36:06 2004 Subject: [python-win32] cx_Oracle import failure Message-ID: Hi folks! I'm a first-time poster to this newsgroup... be gentle! ;-) Box: Dell OptiPlex GX260, 2.4GHz, 500MB RAM OS: Win2k with all the latest patches. ODBC: Oracle ODBC 8.01.07.00 Software: Boa_Constructor 0.2.3 with the usual requirements (wxWindows, pxPython, etc.) running on top of Python 2.3.2 I've developed a Python app (my first) using mxODBC as the driver connecting my GUI to our Oracle 8.1.7 backend. It works beautifully and is very fast. However, my backend connection is not classed and mxODBC lacks some cursor object methods which I want to incorporate into my own cursor class -- nextrow, prevrow, firstrow, lastrow, etc... (mxODBC's '.next()' and '.scroll()' aren't what I want.) So, I decided to look into cx_Oracle and see if it offered the methods I want. I downloaded "cx_Oracle-3.1-win32-8i-py23.exe" and its associated tools and installed them. "import cx_Oracle" gives the following error: "The procedure entry point OCISessionGet could not be located in the Dynamic Linked Library oci.dll" I reverted back to Python 2.2 and related software but got the same message. In checking around the internet a couple of solutions were offered: 1) put the path to "C:\OraHome1\bin" in the environment path var - this didn't work 2) put the path to "C:\OraHome1\bin" in the system path var - this didn't work. 3) another helper offered: "The reason you are getting that error is that the version of cx_Oracle that is current only supports Oracle 8.1.x and above. Oracle has long since dropped support for Oracle 8.0.x and so I dropped support for it as well. If you absolutely must continue using 8.0.x with all of its bugs (8.1.7 and 9.2.0 are much more stable) then I can provide you with the source for the last version that supported 8.0.x or I can tell you which source needs to be changed to support 8.0.x. Let me know. Thanks." but, I am running 8.1.7, so this isn't a solution. For grins and giggles I tried the "cx_Oracle-4.0-win32-9i-py23.exe" version and got the same error msg. 4) "Andy" offered this advice to someone else having the same problem: "Well, you've got me beaten. I tried to break my system by downloading the Windows binary for Python 2.2 and Oracle8i, even though I have the 9i client - and it still worked. The only combination I haven't tried, and I'm not going to, is the cx_Oracle binary built against the Oracle9i client with the Oracle8i client software which I suspect would break in the manner you describe. As many people are successfully using cx_Oracle and you are the only one seeing this problem I still suspect the solution to your problem is in the combination of software you have running on your machine rather than a bug in cx_Oracle, Python or Oracle." So, apparently some folks using my hardware/software environment are getting cx_Oracle to run, but after repeatedly installing and un-installing various versions of ALL the software from Python on down I am still greeted with the same response. Anyone have a solution to this problem? TIA! =========== JLKreps From alex at moreati.org.uk Fri Feb 13 18:14:14 2004 From: alex at moreati.org.uk (Alex Willmer) Date: Fri Feb 13 18:14:16 2004 Subject: [python-win32] cx_Oracle import failure In-Reply-To: References: Message-ID: <200402132314.14901.alex@moreati.org.uk> On Friday 13 Feb 2004 17:33, jkreps@rev.state.ne.us wrote: > Hi folks! > I'm a first-time poster to this newsgroup... be gentle! ;-) > > Box: > Dell OptiPlex GX260, 2.4GHz, 500MB RAM > OS: > Win2k with all the latest patches. > > ODBC: > Oracle ODBC 8.01.07.00 > hmmm > I downloaded "cx_Oracle-3.1-win32-8i-py23.exe" and its associated tools > and installed them. > > "import cx_Oracle" gives the following error: > "The procedure entry point OCISessionGet could not be located in the > Dynamic Linked Library oci.dll" > I reverted back to Python 2.2 and related software but got the same > message. > Please don't take offence if I'm barking up the wrong tree; but you do have the Oracle client libraries installed? By that I mean the OCI libraries installed to %ORACLE_HOME% from the Oracle 8.1.7 CD. The ODBC driver is not sufficient for cx_Oracle, it requires the native OCI libraries provided by Oracle. Regards Alex From jkreps at rev.state.ne.us Tue Feb 17 11:32:07 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Tue Feb 17 13:15:18 2004 Subject: [python-win32] cx_Oracle import failure Message-ID: Hi Alex, Thanks for the reply. The Oracle admin had installed the complete set of programmer tools on my workstation, which included OCI and the rest. It surprises me that mxODBC would import but cx_Oracle would not and because mxODBC worked I never considered a corrupted Oracle installation. As a test, I attempted to run PLSQL Developer, and a browser app that is a GUI to our Oracle back-end, and both failed with the same error msg that cx_Oracle was throwing. I hadn't visited either application for a while and they were both working fine the last time I was developing in them. It seems that some of my Oracle files were deleted and some corrupted. The admin removed and reinstalled the Oracle programming tools and cx_Oracle now imports fine. Thanks, Jerry From parente at cs.unc.edu Thu Feb 5 15:48:09 2004 From: parente at cs.unc.edu (Peter Parente) Date: Wed Feb 18 15:00:42 2004 Subject: [python-win32] Persistent COM server? (GetObject?) Message-ID: <4022AC09.2000305@cs.unc.edu> Is it possible to create a COM server in Python that persists even after the client that created it has finished using it and ends? For instance, I want to allow a COM client to instantiate my COM server if it is not already running. When that client finishes working with the COM server, I want the server to persist and wait around for the next client to contact it. The server never needs to quit. To me, this sounds a lot like using the GetObject function for COM. The client calls GetObject and passes the function the name of the server class. If the server is running, an instance to that server is returned. If the server is not running, it is started and an instance is returned. Is it possible to use GetObject to retrieve a reference to or start a Python COM server? Would this give me a persistent COM server that would exist past the lifetime of a client using it? Thanks, Peter Parente From rwupole at msn.com Sun Feb 8 05:36:11 2004 From: rwupole at msn.com (Roger Upole) Date: Wed Feb 18 15:00:46 2004 Subject: [python-win32] win32security.SID - System Error Message-ID: <001201c3ee2f$633d2110$6111780a@rupole> It appears that the manual constructor is assuming that the sub-authorities are going to be Long objects, and not doing any type-checking or error checking, leaving an exception hanging. You can trigger the same behaviour with win32security.SID ((0, 0, 0, 0, 0, 5), ('x','y')) Looks like for a workaround, you can use win32security.SID ((0, 0, 0, 0, 0, 5), (long(21), long(1511986248))) Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040208/05cacbbe/attachment.html From jhj022 at student.uit.no Mon Feb 9 06:33:54 2004 From: jhj022 at student.uit.no (Jan Heier Johansen) Date: Wed Feb 18 15:00:48 2004 Subject: [python-win32] Problems with win32com and IE, WindowState Message-ID: <1076326434.1044.1.camel@ember31.student.uit.no> Background: I am a newbe trying to store the state of an Internet Explorer Application with the use of win32.com and python. I use python 2.3. Problem 1: The state is accessible, but not the hole state. I am missing the possibility to retrieve if the IE is minimized or not, also known as WindowState for word application. This could be found by detecting that the value of top and left is -32000, but will not help me in restoring the value to its old value. I wish to find the WindowState for the IE object and if the object is minimized I would like to get the Top and Left position of the object if restored. Code: import win32com.client ie=win32com.client.Dispatch('InternetExplorer.Application') ie.Visible=1 Problem 2: Would like to find out if the favourites toolbar is open or not. I can not find out how to retrieve this property. Thanks in advance. From rjones at clayelectric.com Wed Feb 18 12:47:47 2004 From: rjones at clayelectric.com (Ronnie Jones) Date: Wed Feb 18 15:00:50 2004 Subject: [python-win32] py2exe and missing pythoncom.dll Message-ID: I am trying to build a COM application using py2exe. I am using activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3. I run "python setup.py py2exe" at the command line and all builds ok with the following line at the bottom. The following modules are missing ['pythoncom'] The following files are placed in the dist directory. MFC42.DLL PyWinTypes23.dll _sre.pyd boxcar.exe datetime.pyd library.zip python23.dll unicodedata.pyd w9xpopen.exe win32api.pyd win32ui.pyd zlib.pyd The executable runs fine on this machine or any machine with activepython 2.3.2-232 installed. However, when run on another machine of course it bombs with the exception can't load pythoncom. There is no pythoncom DLL in the above list. On another machine I can take the same script and setup.py and run the same command line using activepython 2.2.1-222 and py2exe 0.3.3 for python2.2 and it compiles fine without the modules missing line and it generates the following files. PyWinTypes22.dll _sre.pyd boxcar.exe file.txt python22.dll pythoncom22.dll win32api.pyd win32trace.pyd win32ui.pyd zlib.pyd As you can see pythoncom22.dll included. Am I doing anything wrong. I do not see in the command line options for py2exe anything that would help but I may be missing something. Any help would be appreciated. Ron -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040218/8b795ddb/attachment.html From theller at python.net Thu Feb 19 02:33:04 2004 From: theller at python.net (Thomas Heller) Date: Thu Feb 19 02:33:17 2004 Subject: [python-win32] Re: py2exe and missing pythoncom.dll References: Message-ID: Ronnie Jones writes: > I am trying to build a COM application using py2exe. I am using > activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3. I run "python > setup.py py2exe" at the command line and all builds ok with the following > line at the bottom. > > > > The following modules are missing > > ['pythoncom'] I would guess the win32all build included with activepython is too old for py2exe 0.5.0. Thomas From s.kroeger at biologie.hu-berlin.de Thu Feb 19 05:06:18 2004 From: s.kroeger at biologie.hu-berlin.de (Stefan Kroeger) Date: Thu Feb 19 05:17:52 2004 Subject: [python-win32] How can I manipulate the input of other Windows Programs? Message-ID: <40348A9A.2010209@biologie.hu-berlin.de> Hello, I am newbee to Windows programming, but have some python experience. I am writing a Pythonprogram that (when working) should do the following: -automatically put some value in the dialogbox of another (Non Python) Program and hit afterwards How far have I gotten? I have mangaged to get a handle to the dialogbox (Childwindow?) with: fg_w=win32gui.GetForegroundWindow() and checked if I was in the right one with the following line: win32gui.GetWindowText(fg_w) I know that is not too much;) but I am absolutly stuck. Could anyone please help me by telling me: how to get a handle to the inputfield of my dialogbox and how manipulate it? Thanks, Stefan Kroeger From bgailer at alum.rpi.edu Thu Feb 19 14:03:29 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Thu Feb 19 14:03:33 2004 Subject: [python-win32] PythonWin on Win 200s Server In-Reply-To: <3FC80D4C.5050508@hotpop.com> References: <3FC80D4C.5050508@hotpop.com> Message-ID: <6.0.0.22.0.20040219114210.036d4a50@mail.mric.net> I am having one hell of a time getting PythonWin 163 to work reliably on Win 2003 Server. I have been thru a number of reinstalls of the op sys, installing each time less software, and still running into problems. What manifests now is (1) PythonWin starts and runs slow. (2) when debugging it reports a loadbarstate failure, and now even the menus don't drop down. I can't even uninstall it! Could not open INSTALL.LOG fiile. Am I just out of luck? It seems that I've worked with PythonWin with great success for 2 or so years Win 2000 and Win 2003) , and now it it just dying on me. I will (once again) install the op sys, and ONE program at a time (which is what I was doing), till I see the point at which something is destroyed that causes PythonWin to fail. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From spencer at efn.org Thu Feb 19 18:25:36 2004 From: spencer at efn.org (spencer@efn.org) Date: Thu Feb 19 18:25:43 2004 Subject: [python-win32] How can I manipulate the input of other In-Reply-To: References: Message-ID: <1077233136.403545f0251b4@webmail.efn.org> Goto MSDN and the Win32 extensions documentation Win32API/Modules/win32gui and read about GetDlgItem() GetDltItemText() and such. HTH Spencer Doidge Quoting python-win32-request@python.org: > 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 > python-win32-request@python.org > > You can reach the person managing the list at > python-win32-owner@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Python-win32 digest..." > > > Today's Topics: > > 1. Persistent COM server? (GetObject?) (Peter Parente) > 2. Problems with win32com and IE, WindowState (Jan Heier Johansen) > 3. win32security.SID - System Error (Roger Upole) > 4. py2exe and missing pythoncom.dll (Ronnie Jones) > 5. Re: py2exe and missing pythoncom.dll (Thomas Heller) > 6. How can I manipulate the input of other Windows Programs? > (Stefan Kroeger) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 05 Feb 2004 15:48:09 -0500 > From: Peter Parente > Subject: [python-win32] Persistent COM server? (GetObject?) > To: python-win32@python.org > Message-ID: <4022AC09.2000305@cs.unc.edu> > Content-Type: text/plain; charset=us-ascii; format=flowed > > Is it possible to create a COM server in Python that persists even after > the client that created it has finished using it and ends? For instance, > I want to allow a COM client to instantiate my COM server if it is not > already running. When that client finishes working with the COM server, > I want the server to persist and wait around for the next client to > contact it. The server never needs to quit. > > To me, this sounds a lot like using the GetObject function for COM. The > client calls GetObject and passes the function the name of the server > class. If the server is running, an instance to that server is returned. > If the server is not running, it is started and an instance is returned. > > Is it possible to use GetObject to retrieve a reference to or start a > Python COM server? Would this give me a persistent COM server that would > exist past the lifetime of a client using it? > > Thanks, > Peter Parente > > > > ------------------------------ > > Message: 2 > Date: Mon, 09 Feb 2004 12:33:54 +0100 > From: Jan Heier Johansen > Subject: [python-win32] Problems with win32com and IE, WindowState > To: python-win32@python.org > Message-ID: <1076326434.1044.1.camel@ember31.student.uit.no> > Content-Type: text/plain > > Background: I am a newbe trying to store the state of an Internet > Explorer Application with the use of win32.com and python. I use > python 2.3. > > Problem 1: The state is accessible, but not the hole state. I am > missing the possibility to retrieve if the IE is minimized or not, > also known as WindowState for word application. This could be found by > detecting that the value of top and left is -32000, but will not help > me in restoring the value to its old value. I wish to find the > WindowState for the IE object and if the object is minimized I would > like to get the Top and Left position of the object if restored. > > Code: > import win32com.client > ie=win32com.client.Dispatch('InternetExplorer.Application') > ie.Visible=1 > > Problem 2: Would like to find out if the favourites toolbar is open or > not. I can not find out how to retrieve this property. > > Thanks in advance. > > > > > ------------------------------ > > Message: 3 > Date: Sun, 8 Feb 2004 02:36:11 -0800 > From: "Roger Upole" > Subject: [python-win32] win32security.SID - System Error > To: > Message-ID: <001201c3ee2f$633d2110$6111780a@rupole> > Content-Type: text/plain; charset="windows-1252" > > It appears that the manual constructor is assuming that > the sub-authorities are going to be Long objects, and not > doing any type-checking or error checking, leaving an > exception hanging. You can trigger the same behaviour with > > win32security.SID ((0, 0, 0, 0, 0, 5), ('x','y')) > > Looks like for a workaround, you can use > > win32security.SID ((0, 0, 0, 0, 0, 5), (long(21), long(1511986248))) > > Roger > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/python- win32/attachments/20040208/05cacbbe/attachment-0001.html > > ------------------------------ > > Message: 4 > Date: Wed, 18 Feb 2004 12:47:47 -0500 > From: Ronnie Jones > Subject: [python-win32] py2exe and missing pythoncom.dll > To: "'python-win32@python.org'" > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > I am trying to build a COM application using py2exe. I am using > activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3. I run "python > setup.py py2exe" at the command line and all builds ok with the following > line at the bottom. > > > > The following modules are missing > > ['pythoncom'] > > > > The following files are placed in the dist directory. > > > > MFC42.DLL > > PyWinTypes23.dll > > _sre.pyd > > boxcar.exe > > datetime.pyd > > library.zip > > python23.dll > > unicodedata.pyd > > w9xpopen.exe > > win32api.pyd > > win32ui.pyd > > zlib.pyd > > > > The executable runs fine on this machine or any machine with activepython > 2.3.2-232 installed. However, when run on another machine of course it > bombs with the exception can't load pythoncom. There is no pythoncom DLL in > the above list. > > > > On another machine I can take the same script and setup.py and run the same > command line using activepython 2.2.1-222 and py2exe 0.3.3 for python2.2 and > it compiles fine without the modules missing line and it generates the > following files. > > > > PyWinTypes22.dll > > _sre.pyd > > boxcar.exe > > file.txt > > python22.dll > > pythoncom22.dll > > win32api.pyd > > win32trace.pyd > > win32ui.pyd > > zlib.pyd > > > > As you can see pythoncom22.dll included. > > > > Am I doing anything wrong. I do not see in the command line options for > py2exe anything that would help but I may be missing something. Any help > would be appreciated. > > > > Ron > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/python- win32/attachments/20040218/8b795ddb/attachment-0001.html > > ------------------------------ > > Message: 5 > Date: Thu, 19 Feb 2004 08:33:04 +0100 > From: Thomas Heller > Subject: [python-win32] Re: py2exe and missing pythoncom.dll > To: python-win32@python.org > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Ronnie Jones writes: > > > I am trying to build a COM application using py2exe. I am using > > activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3. I run "python > > setup.py py2exe" at the command line and all builds ok with the following > > line at the bottom. > > > > > > > > The following modules are missing > > > > ['pythoncom'] > > I would guess the win32all build included with activepython is too old > for py2exe 0.5.0. > > Thomas > > > > > ------------------------------ > > Message: 6 > Date: Thu, 19 Feb 2004 11:06:18 +0100 > From: Stefan Kroeger > Subject: [python-win32] How can I manipulate the input of other > Windows Programs? > To: python-win32@python.org > Message-ID: <40348A9A.2010209@biologie.hu-berlin.de> > Content-Type: text/plain; charset=us-ascii; format=flowed > > Hello, > > I am newbee to Windows programming, but have some python experience. > I am writing a Pythonprogram that (when working) should do the following: > > -automatically put some value in the dialogbox of another (Non Python) > Program and hit afterwards > > How far have I gotten? I have mangaged to get a handle to the dialogbox > (Childwindow?) with: > > fg_w=win32gui.GetForegroundWindow() > > > and checked if I was in the right one with the following line: > > win32gui.GetWindowText(fg_w) > > > I know that is not too much;) but I am absolutly stuck. > Could anyone please help me by telling me: how to get a handle to the > inputfield of my dialogbox and how manipulate it? > > Thanks, > > Stefan Kroeger > > > > > ------------------------------ > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of Python-win32 Digest, Vol 11, Issue 10 > ******************************************** > > From dave at psys.org Thu Feb 19 18:40:54 2004 From: dave at psys.org (d.w. harks) Date: Thu Feb 19 18:40:59 2004 Subject: [python-win32] ImpersonateUser and os.popen4 Message-ID: <20040219234054.GN10783@psys.org> Greetings, fellow Pythonistas. I'm working with someone on an installer program which needs to call a Windows process as a different user. So I went about discovering the ImpersonateUser calls, and have some code like this: def Logon(self): self.mHandle = win32security.LogonUser(self.mUser,self.mDomain,self.mPassword,win32con.LOGON32_LOGON_INTERACTIVE,win32con.LOGON32_PROVIDER_DEFAULT) win32security.ImpersonateLoggedOnUser(self.mHandle) So, I execute this, and then go about my tasks as my new user. Fantastic. If, at this point I call win32api.GetUserName(), I get the impersonated user, 'installer'. But if I call an external process, perhaps a short script which just calls win32api.GetUserName()... i, o = os.popen4(r"C:\Python23\python.exe C:\\PrintUserName.py") --> 'harksd' I've also tried using a WScript.Shell to call the same script, with the same result. So, apparently an impersonated user cannot create processes with its own credentials. Is there any way to do so? If not, is there any way to create AND DELETE services using win32all? (the point of this is to call the SC command) Thanks, I appreciate any pointers you might have. dave -- David W. Harks http://dwblog.psys.org From spencer at efn.org Thu Feb 19 18:41:51 2004 From: spencer at efn.org (spencer@efn.org) Date: Thu Feb 19 18:41:54 2004 Subject: [python-win32] How can I manipulate the input of other Windows Programs? In-Reply-To: References: Message-ID: <1077234111.403549bf4bb41@webmail.efn.org> There's also a lot of demo script code in D:\Python23\Lib\site-packages\Pythonwin\pywin\tools\ Search that directory for "GetDlgItem" sd Quoting python-win32-request@python.org: > 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 > python-win32-request@python.org > > You can reach the person managing the list at > python-win32-owner@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Python-win32 digest..." > > > Today's Topics: > > 1. Persistent COM server? (GetObject?) (Peter Parente) > 2. Problems with win32com and IE, WindowState (Jan Heier Johansen) > 3. win32security.SID - System Error (Roger Upole) > 4. py2exe and missing pythoncom.dll (Ronnie Jones) > 5. Re: py2exe and missing pythoncom.dll (Thomas Heller) > 6. How can I manipulate the input of other Windows Programs? > (Stefan Kroeger) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 05 Feb 2004 15:48:09 -0500 > From: Peter Parente > Subject: [python-win32] Persistent COM server? (GetObject?) > To: python-win32@python.org > Message-ID: <4022AC09.2000305@cs.unc.edu> > Content-Type: text/plain; charset=us-ascii; format=flowed > > Is it possible to create a COM server in Python that persists even after > the client that created it has finished using it and ends? For instance, > I want to allow a COM client to instantiate my COM server if it is not > already running. When that client finishes working with the COM server, > I want the server to persist and wait around for the next client to > contact it. The server never needs to quit. > > To me, this sounds a lot like using the GetObject function for COM. The > client calls GetObject and passes the function the name of the server > class. If the server is running, an instance to that server is returned. > If the server is not running, it is started and an instance is returned. > > Is it possible to use GetObject to retrieve a reference to or start a > Python COM server? Would this give me a persistent COM server that would > exist past the lifetime of a client using it? > > Thanks, > Peter Parente > > > > ------------------------------ > > Message: 2 > Date: Mon, 09 Feb 2004 12:33:54 +0100 > From: Jan Heier Johansen > Subject: [python-win32] Problems with win32com and IE, WindowState > To: python-win32@python.org > Message-ID: <1076326434.1044.1.camel@ember31.student.uit.no> > Content-Type: text/plain > > Background: I am a newbe trying to store the state of an Internet > Explorer Application with the use of win32.com and python. I use > python 2.3. > > Problem 1: The state is accessible, but not the hole state. I am > missing the possibility to retrieve if the IE is minimized or not, > also known as WindowState for word application. This could be found by > detecting that the value of top and left is -32000, but will not help > me in restoring the value to its old value. I wish to find the > WindowState for the IE object and if the object is minimized I would > like to get the Top and Left position of the object if restored. > > Code: > import win32com.client > ie=win32com.client.Dispatch('InternetExplorer.Application') > ie.Visible=1 > > Problem 2: Would like to find out if the favourites toolbar is open or > not. I can not find out how to retrieve this property. > > Thanks in advance. > > > > > ------------------------------ > > Message: 3 > Date: Sun, 8 Feb 2004 02:36:11 -0800 > From: "Roger Upole" > Subject: [python-win32] win32security.SID - System Error > To: > Message-ID: <001201c3ee2f$633d2110$6111780a@rupole> > Content-Type: text/plain; charset="windows-1252" > > It appears that the manual constructor is assuming that > the sub-authorities are going to be Long objects, and not > doing any type-checking or error checking, leaving an > exception hanging. You can trigger the same behaviour with > > win32security.SID ((0, 0, 0, 0, 0, 5), ('x','y')) > > Looks like for a workaround, you can use > > win32security.SID ((0, 0, 0, 0, 0, 5), (long(21), long(1511986248))) > > Roger > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/python- win32/attachments/20040208/05cacbbe/attachment-0001.html > > ------------------------------ > > Message: 4 > Date: Wed, 18 Feb 2004 12:47:47 -0500 > From: Ronnie Jones > Subject: [python-win32] py2exe and missing pythoncom.dll > To: "'python-win32@python.org'" > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > I am trying to build a COM application using py2exe. I am using > activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3. I run "python > setup.py py2exe" at the command line and all builds ok with the following > line at the bottom. > > > > The following modules are missing > > ['pythoncom'] > > > > The following files are placed in the dist directory. > > > > MFC42.DLL > > PyWinTypes23.dll > > _sre.pyd > > boxcar.exe > > datetime.pyd > > library.zip > > python23.dll > > unicodedata.pyd > > w9xpopen.exe > > win32api.pyd > > win32ui.pyd > > zlib.pyd > > > > The executable runs fine on this machine or any machine with activepython > 2.3.2-232 installed. However, when run on another machine of course it > bombs with the exception can't load pythoncom. There is no pythoncom DLL in > the above list. > > > > On another machine I can take the same script and setup.py and run the same > command line using activepython 2.2.1-222 and py2exe 0.3.3 for python2.2 and > it compiles fine without the modules missing line and it generates the > following files. > > > > PyWinTypes22.dll > > _sre.pyd > > boxcar.exe > > file.txt > > python22.dll > > pythoncom22.dll > > win32api.pyd > > win32trace.pyd > > win32ui.pyd > > zlib.pyd > > > > As you can see pythoncom22.dll included. > > > > Am I doing anything wrong. I do not see in the command line options for > py2exe anything that would help but I may be missing something. Any help > would be appreciated. > > > > Ron > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://mail.python.org/pipermail/python- win32/attachments/20040218/8b795ddb/attachment-0001.html > > ------------------------------ > > Message: 5 > Date: Thu, 19 Feb 2004 08:33:04 +0100 > From: Thomas Heller > Subject: [python-win32] Re: py2exe and missing pythoncom.dll > To: python-win32@python.org > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Ronnie Jones writes: > > > I am trying to build a COM application using py2exe. I am using > > activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3. I run "python > > setup.py py2exe" at the command line and all builds ok with the following > > line at the bottom. > > > > > > > > The following modules are missing > > > > ['pythoncom'] > > I would guess the win32all build included with activepython is too old > for py2exe 0.5.0. > > Thomas > > > > > ------------------------------ > > Message: 6 > Date: Thu, 19 Feb 2004 11:06:18 +0100 > From: Stefan Kroeger > Subject: [python-win32] How can I manipulate the input of other > Windows Programs? > To: python-win32@python.org > Message-ID: <40348A9A.2010209@biologie.hu-berlin.de> > Content-Type: text/plain; charset=us-ascii; format=flowed > > Hello, > > I am newbee to Windows programming, but have some python experience. > I am writing a Pythonprogram that (when working) should do the following: > > -automatically put some value in the dialogbox of another (Non Python) > Program and hit afterwards > > How far have I gotten? I have mangaged to get a handle to the dialogbox > (Childwindow?) with: > > fg_w=win32gui.GetForegroundWindow() > > > and checked if I was in the right one with the following line: > > win32gui.GetWindowText(fg_w) > > > I know that is not too much;) but I am absolutly stuck. > Could anyone please help me by telling me: how to get a handle to the > inputfield of my dialogbox and how manipulate it? > > Thanks, > > Stefan Kroeger > > > > > ------------------------------ > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of Python-win32 Digest, Vol 11, Issue 10 > ******************************************** > > From bgailer at alum.rpi.edu Thu Feb 19 20:01:07 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Thu Feb 19 20:01:27 2004 Subject: [python-win32] PythonWin on Win 200s Server In-Reply-To: References: Message-ID: <6.0.0.22.0.20040219175852.049fb3f8@mail.mric.net> At 12:08 PM 2/19/2004, jkreps@rev.state.ne.us wrote: > > >Bob Gailer >wrote: > >I am having one hell of a time getting PythonWin 163 to work reliably on >Win 2003 Server. > >I have been thru a number of reinstalls of the op sys, installing each time > >less software, and still running into problems. What manifests now is (1) >PythonWin starts and runs slow. (2) when debugging >it reports a loadbarstate failure, and now even the menus don't drop down. > >I can't even uninstall it! Could not open INSTALL.LOG fiile. > >Am I just out of luck? It seems that I've worked with PythonWin with great >success for 2 or so years Win 2000 and Win 2003) , and now it it just dying >on me. > >I will (once again) install the op sys, and ONE program at a time (which is > >what I was doing), till I see the point at which something is destroyed >that causes PythonWin to fail. > >Bob Gailer > > >Bob, >Maybe it's not Python. >Perhaps the problems you're having are reflective of a lot of problems >other users of Win2003 servers are having. Forbes recently moved them out >of their data processing center because of reiliability, compatibility and >other problems .... I just backed up to Win 2000 and things seem to be working OK. I wonder why MS is so good at advertising and not so good at delivery. Sigh. I was enjoying many of the Win 2003 features, but just could not get my job done. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From rwupole at msn.com Fri Feb 20 02:45:07 2004 From: rwupole at msn.com (Roger Upole) Date: Thu Feb 19 23:28:48 2004 Subject: [python-win32] ImpersonateUser and os.popen4 Message-ID: <001501c3f785$7777d940$ef17c943@rupole> You can call win32process.CreateProcessAsUser with the logon token you created. Although if all you need to do is manipulate services, the win32service module should be able to do anything you need. hth Roger [hope this isn't a repeat, the first time it got bounced by a spam filter ????] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040219/61c074b5/attachment-0001.html From prouleau at impathnetworks.com Fri Feb 20 16:36:25 2004 From: prouleau at impathnetworks.com (Pierre Rouleau) Date: Fri Feb 20 16:31:11 2004 Subject: [python-win32] How do you retrieve the name of the network adapters of a local machine Message-ID: I am looking for a way to retrieve the name of the local network adapter(s) used by a computer. I have working C++ code that reads them via the registry looking at "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" There must be an OS function call that can be used for that purpose and is valid on several versions of Windows (I am looking for NT4 and up). Does anyone know where I should look (or better what would be the function or API) Hopefully that function would be available in PyWin32, but if it is not, I would write a wrapper to access through Python. Thanks in advance for any information. Pierre From rwupole at msn.com Fri Feb 20 22:22:55 2004 From: rwupole at msn.com (Roger Upole) Date: Fri Feb 20 19:06:36 2004 Subject: [python-win32] How do you retrieve the name of the network adapters Message-ID: <000601c3f82a$0150e720$0417c943@rupole> You can use WMI. import win32com.client wmi=win32com.client.GetObject('winmgmts:') adapters=wmi.InstancesOf('win32_networkadapter') for adapter in adapters: for p in adapter.Properties_: print p.Name, p.Value Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040220/5a0fa7ed/attachment.html From prouleau at impathnetworks.com Fri Feb 20 19:33:45 2004 From: prouleau at impathnetworks.com (Pierre Rouleau) Date: Fri Feb 20 19:33:44 2004 Subject: [python-win32] Re: How do you retrieve the name of the network adapters In-Reply-To: <000601c3f82a$0150e720$0417c943@rupole> References: <000601c3f82a$0150e720$0417c943@rupole> Message-ID: Roger Upole wrote: > You can use WMI. > > import win32com.client > wmi=win32com.client.GetObject('winmgmts:') > adapters=wmi.InstancesOf('win32_networkadapter') > for adapter in adapters: > for p in adapter.Properties_: > print p.Name, p.Value > > Roger > Thanks Roger. I did not know the WMI. Looks like we can get a lot of information through this. I'll have to read through the WMI docs to learn more. Any suggestion as to what would be the best place to start? Pierre From prouleau at impathnetworks.com Fri Feb 20 20:28:07 2004 From: prouleau at impathnetworks.com (Pierre Rouleau) Date: Fri Feb 20 20:28:22 2004 Subject: [python-win32] Re: How do you retrieve the name of the network adapters In-Reply-To: References: <000601c3f82a$0150e720$0417c943@rupole> Message-ID: Pierre Rouleau wrote: > Roger Upole wrote: > >> You can use WMI. >> >> import win32com.client >> wmi=win32com.client.GetObject('winmgmts:') >> adapters=wmi.InstancesOf('win32_networkadapter') >> for adapter in adapters: >> for p in adapter.Properties_: >> print p.Name, p.Value >> Roger >> > > Thanks Roger. > > I did not know the WMI. Looks like we can get a lot of information > through this. I'll have to read through the WMI docs to learn more. Any > suggestion as to what would be the best place to start? > If the best place is MSDN, I found what I was looking for in "Platform SDK: Windows Management Instrumentation". Thanks again Pierre From prouleau at impathnetworks.com Sat Feb 21 13:07:08 2004 From: prouleau at impathnetworks.com (Pierre Rouleau) Date: Sat Feb 21 13:07:09 2004 Subject: [python-win32] Is there Python support for MS Ip Helper API? Message-ID: I have not found any support for the IP Helper API in Mark Hammond's Win32 Extensions for Python (build 163). Did I miss something when searching in its help file or is it simply not supported (yet)? Is it because some of the IP Help functionality is available through the the WMI? Thanks for your help, Pierre From theller at python.net Mon Feb 23 05:26:34 2004 From: theller at python.net (Thomas Heller) Date: Mon Feb 23 05:27:05 2004 Subject: [python-win32] Re: Is there Python support for MS Ip Helper API? References: Message-ID: <1xom852d.fsf@python.net> Pierre Rouleau writes: > I have not found any support for the IP Helper API in Mark Hammond's > Win32 Extensions for Python (build 163). Did I miss something when > searching in its help file or is it simply not supported (yet)? > > Is it because some of the IP Help functionality is available through > the the WMI? Probably because nobody needed it badly enough to provide a patch. OTOH, it may be easier to do it in ctypes, and IIRC someone (Dave Brueck?) posted some code for the IP Helper Api somewhere... Thomas From stefan.holmgren at accalon.se Mon Feb 23 11:33:02 2004 From: stefan.holmgren at accalon.se (Stefan Holmgren) Date: Mon Feb 23 11:41:07 2004 Subject: [python-win32] py2exe 0.5 and WMI? Message-ID: At first... I'm new to py2exe.... the McMillian Installer is not working. I'm running py2exe on windows XP with this options = {"py2exe": {"typelibs": # typelib for WMI [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)], it is working well on that mashine..... When i'm trying to run my new exe-file on windows 2000 i got an error: Traceback (most recent call last): File "wxApp1.py", line 6, in ? File "wxFrame1.pyo", line 9, in ? File "wmi.pyo", line 132, in ? File "win32com\client\gencache.pyo", line 527, in EnsureDispatch File "win32com\client\CLSIDToClass.pyo", line 50, in GetClass KeyError: '{76A6415C-CB41-11D1-8B02-00600806D9B6}' ------------------------------------------------------------------------- Then when I rerun py2exe on my windows 2000, I have to change last digit in option to , 1: options = {"py2exe": {"typelibs": # typelib for WMI [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1)], ok, how can I make this exe-file to work on both XP and 2000?? / Holmis From dtcheung66 at hotmail.com Mon Feb 23 15:27:08 2004 From: dtcheung66 at hotmail.com (Dave) Date: Mon Feb 23 15:22:55 2004 Subject: [python-win32] Python COM Message-ID: I have been trying an example from the Python Programming on Win32 book on the lastest versions of python (2.3.3) and win32all (build 163). I create the COM object and try to call it from VB but i can't seem to create the child. debugging = 1 if debugging: from win32com.server.dispatcher import DefaultDebugDispatcher useDispatcher = DefaultDebugDispatcher else: useDispatcher = None class Parent: _public_methods_ = ['CreateChild', 'KissChild'] _reg_clsid_= "{E8F7F001-DB69-11D2-8531-204C4F4F5020}" _reg_progid_ = "PythonDemos.Parent" def CreateChild(self): child = Child() print "Our Python child is", child wrapped = wrap( child, useDispatcher=useDispatcher ) print "Returning wrapped", wrapped return wrapped def KissChild(self, child): print "KissChild called with child", child dispatch = win32com.client.Dispatch(child) print "KissChild called with child named", dispatch.Name child = umwrap(child) print "The Python child is", child class Child: _public_methods_ = [] _public_attrs_ = ['Name'] def __init__(self): self.name = "Unnamed" if __name__ == '__main__': import win32com.server.register win32com.server.register.UseCommandLine (Parent, debug=debugging) This is the error in the Python Trace Collector: Object with win32trace dispatcher created (object=None) in ._QueryInterface_ with unsupported IID IPersistStreamInit ({7FD52380-4E07-101B-AE2D-08002B2EC713}) in ._QueryInterface_ with unsupported IID IPersistPropertyBag ({37D84F60-42CB-11CE-8135-00AA004BB851}) in _GetIDsOfNames_ with '('CreateChild',)' and '1033' in _Invoke_ with 1000 1033 3 () Traceback (most recent call last): File "C:\Python23\lib\site-packages\win32com\server\dispatcher.py", line 40, i n _Invoke_ return self.policy._Invoke_(dispid, lcid, wFlags, args) File "C:\Python23\lib\site-packages\win32com\server\policy.py", line 275, in _ Invoke_ return self._invoke_(dispid, lcid, wFlags, args) File "C:\Python23\lib\site-packages\win32com\server\policy.py", line 280, in _ invoke_ return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None) File "C:\Python23\lib\site-packages\win32com\server\policy.py", line 541, in _ invokeex_ return func(*args) File "C:\Python23\ParentChild.py", line 16, in CreateChild child = Child() NameError: global name 'Child' is not defined pythoncom error: Python error invoking COM method. Traceback (most recent call last): File "C:\Python23\lib\site-packages\win32com\server\dispatcher.py", line 129, in _Invoke_ return DispatcherBase._Invoke_(self, dispid, lcid, wFlags, args) File "C:\Python23\lib\site-packages\win32com\server\dispatcher.py", line 42, i n _Invoke_ self._HandleException_() File "C:\Python23\lib\site-packages\win32com\server\dispatcher.py", line 107, in _HandleException_ reraise() File "C:\Python23\lib\site-packages\win32com\server\dispatcher.py", line 40, i n _Invoke_ return self.policy._Invoke_(dispid, lcid, wFlags, args) File "C:\Python23\lib\site-packages\win32com\server\policy.py", line 275, in _ Invoke_ return self._invoke_(dispid, lcid, wFlags, args) File "C:\Python23\lib\site-packages\win32com\server\policy.py", line 280, in _ invoke_ return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None) File "C:\Python23\lib\site-packages\win32com\server\policy.py", line 541, in _ invokeex_ return func(*args) File "C:\Python23\ParentChild.py", line 16, in CreateChild child = Child() exceptions.NameError: global name 'Child' is not defined The COM object always seems to fail whenever I call a subclass saying that its not defined. I'm not to sure what the problem is. Any help would be appreciated. Thanks David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040223/16cb1b78/attachment.html From theller at python.net Mon Feb 23 15:26:49 2004 From: theller at python.net (Thomas Heller) Date: Mon Feb 23 15:27:11 2004 Subject: [python-win32] Re: py2exe 0.5 and WMI? References: Message-ID: "Stefan Holmgren" writes: > At first... I'm new to py2exe.... the McMillian Installer is not working. > I'm running py2exe on windows XP with this > options = {"py2exe": {"typelibs": > # typelib for WMI > [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, > 2)], > > it is working well on that mashine..... > > When i'm trying to run my new exe-file on windows 2000 i got an error: > > Traceback (most recent call last): > File "wxApp1.py", line 6, in ? > File "wxFrame1.pyo", line 9, in ? > File "wmi.pyo", line 132, in ? > File "win32com\client\gencache.pyo", line 527, in EnsureDispatch > File "win32com\client\CLSIDToClass.pyo", line 50, in GetClass > KeyError: '{76A6415C-CB41-11D1-8B02-00600806D9B6}' > ------------------------------------------------------------------------- > > Then when I rerun py2exe on my windows 2000, I have to change last digit in > option to , 1: > options = {"py2exe": {"typelibs": > # typelib for WMI > [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, > 1)], > > ok, how can I make this exe-file to work on both XP and 2000?? I don't know if this is really the 'right' thing to do, but it seems to me that there are different typelibs on win2k and XP. You could try to copy the win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 directory from the win2k machine to the XP machine, and build the exe there. options should then probably be set to this: options = {"py2exe": {"typelibs": # typelibs for WMI [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1), ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)], A totally different idea would be to create the makepy wrappers on the target machine, but I'm quite sure that doesn't work currently. If you find a solution (or even if not), it would be nice if you submit a short recipe to the py2exe wiki for people having similar problems. Thomas From theller at python.net Mon Feb 23 15:30:38 2004 From: theller at python.net (Thomas Heller) Date: Mon Feb 23 15:41:32 2004 Subject: [python-win32] Re: Python COM References: Message-ID: "Dave" writes: > I have been trying an example from the Python Programming on Win32 > book on the lastest versions of python (2.3.3) and win32all (build > 163). I create the COM object and try to call it from VB but i can't > seem to create the child. > > debugging = 1 > if debugging: > from win32com.server.dispatcher import DefaultDebugDispatcher > useDispatcher = DefaultDebugDispatcher > else: > useDispatcher = None > > class Parent: > _public_methods_ = ['CreateChild', 'KissChild'] > _reg_clsid_= "{E8F7F001-DB69-11D2-8531-204C4F4F5020}" > _reg_progid_ = "PythonDemos.Parent" > > def CreateChild(self): > child = Child() > print "Our Python child is", child > wrapped = wrap( child, useDispatcher=useDispatcher ) > print "Returning wrapped", wrapped > return wrapped > > def KissChild(self, child): > print "KissChild called with child", child > dispatch = win32com.client.Dispatch(child) > print "KissChild called with child named", dispatch.Name > > child = umwrap(child) > print "The Python child is", child > > class Child: > _public_methods_ = [] > _public_attrs_ = ['Name'] > def __init__(self): > self.name = "Unnamed" [...] > This is the error in the Python Trace Collector: > > Object with win32trace dispatcher created (object=None) > in ._QueryInterface_ with unsupported > IID IPersistStreamInit ({7FD52380-4E07-101B-AE2D-08002B2EC713}) > in ._QueryInterface_ with unsupported > IID IPersistPropertyBag ({37D84F60-42CB-11CE-8135-00AA004BB851}) > in _GetIDsOfNames_ with '('CreateChild',)' and '1033' > > in _Invoke_ with 1000 1033 3 () > Traceback (most recent call last): [...] > File "C:\Python23\ParentChild.py", line 16, in CreateChild > child = Child() > NameError: global name 'Child' is not defined Python is correct here: Child is not defined in the Parent's CreateChild method. You must start the definition of class Child in column 1 like so: class Parent: def ..... ...... class Child: _public_methods_ = [] _public_attrs_ = ['Name'] def __init__(self): self.name = "Unnamed" Thomas From stefan.holmgren at accalon.se Tue Feb 24 06:04:59 2004 From: stefan.holmgren at accalon.se (Stefan Holmgren) Date: Tue Feb 24 06:06:31 2004 Subject: [python-win32] Re: py2exe 0.5 and WMI? References: Message-ID: Hi, Thomas... I made this thing to work, but I don't think it's a nice way to solve it... .. At first I did a setup.py py2exe as below on my XP. .. Then I opened the shared.zip and extracted all 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' files .. and renamed them to 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1' .. appended the new structur into the zip-file.. .. In shared.zip I now got same files doubled 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' and 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1' Hope u understand what I have done! This is working for me.... /Holmis "Thomas Heller" skrev i meddelandet news:smh15ypi.fsf@python.net... > "Stefan Holmgren" writes: > > > At first... I'm new to py2exe.... the McMillian Installer is not working. > > I'm running py2exe on windows XP with this > > options = {"py2exe": {"typelibs": > > # typelib for WMI > > [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, > > 2)], > > > > it is working well on that mashine..... > > > > When i'm trying to run my new exe-file on windows 2000 i got an error: > > > > Traceback (most recent call last): > > File "wxApp1.py", line 6, in ? > > File "wxFrame1.pyo", line 9, in ? > > File "wmi.pyo", line 132, in ? > > File "win32com\client\gencache.pyo", line 527, in EnsureDispatch > > File "win32com\client\CLSIDToClass.pyo", line 50, in GetClass > > KeyError: '{76A6415C-CB41-11D1-8B02-00600806D9B6}' > > ------------------------------------------------------------------------- > > > > Then when I rerun py2exe on my windows 2000, I have to change last digit in > > option to , 1: > > options = {"py2exe": {"typelibs": > > # typelib for WMI > > [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, > > 1)], > > > > ok, how can I make this exe-file to work on both XP and 2000?? > > I don't know if this is really the 'right' thing to do, but it seems to > me that there are different typelibs on win2k and XP. You could try to > copy the win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 > directory from the win2k machine to the XP machine, and build the exe > there. > > options should then probably be set to this: > > options = {"py2exe": {"typelibs": > # typelibs for WMI > [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1), > ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)], > > > A totally different idea would be to create the makepy wrappers on the > target machine, but I'm quite sure that doesn't work currently. > > If you find a solution (or even if not), it would be nice if you submit > a short recipe to the py2exe wiki for people having similar problems. > > Thomas From therve at neocles.com Wed Feb 25 04:54:44 2004 From: therve at neocles.com (Thomas HERVE) Date: Wed Feb 25 04:56:36 2004 Subject: [python-win32] Problem with win32pdh.GetCounterInfo Message-ID: I try to get some monitoring information on Windows Station. My installation is Windows Server 2003, in french. I use python 2.3 and win32all-163. Here is my script : >>> import win32pdh >>> path = win32pdh.MakeCounterPath((None,"Processeur", "_Total", None, -1, "% Temps processeur")) >>> base = win32pdh.OpenQuery() >>> counter = win32pdh.AddCounter(base, path) >>> win32pdh.GetCounterInfo(counter, 0) Traceback (most recent call last): File "", line 1, in ? error: (-2147481646, 'GetCounterInfo for size', 'No error message is available') But if i do : >>> win32pdh.CollectQueryData(base) >>> win32pdh.CollectQueryData(base) >>> win32pdh.GetFormattedCounterValue(hc,win32pdh.PDH_FMT_LONG) (558957824, 6) So my counter is "well formed". I try to look into the sources but nothing seems to be incorrect to me. If there's any problem with it (maybe localisation ? I've seen lots of problem from this), please let me know. And if course you have one solution it's even better. Thanks in advance, -- Thomas Herve From therve at neocles.com Wed Feb 25 06:23:31 2004 From: therve at neocles.com (Thomas HERVE) Date: Wed Feb 25 06:24:41 2004 Subject: [python-win32] Problem with win32pdh.GetCounterInfo Message-ID: I try to get some monitoring information on Windows Station. My installation is Windows Server 2003, in french. I use python 2.3 and win32all-163. Here is my script : >>> import win32pdh >>> path = win32pdh.MakeCounterPath((None,"Processeur", "_Total", None, -1, "% Temps processeur")) >>> base = win32pdh.OpenQuery() >>> counter = win32pdh.AddCounter(base, path) >>> win32pdh.GetCounterInfo(counter, 0) Traceback (most recent call last): File "", line 1, in ? error: (-2147481646, 'GetCounterInfo for size', 'No error message is available') But if i do : >>> win32pdh.CollectQueryData(base) >>> win32pdh.CollectQueryData(base) >>> win32pdh.GetFormattedCounterValue(hc,win32pdh.PDH_FMT_LONG) (558957824, 6) So my counter is "well formed". Ok I reply to myself after get a further look in win32pdhmodule.cpp. I see that function (*pPdhMakeCounterPath) (&cpe, NULL, &bufSize, flags); don't work with an bufSize set to zero, in order to return size needed, as it's specified in msdn documentation. Furthermore, thinking at it made me realize that "-2147481646" corresponds to 0x800007D2, pdh error PDH_MORE_DATA : "There is more data to return than would fit in the supplied buffer. Allocate a larger buffer and call the function again." So the pretended behaviour of PdhGetCounterInfo seems to be wrong... I think the work that has been done to MakeCounterPath should be done in GetCounterInfo, ie hard-coding the size of the buffer. I hope I'm clear enough to be understood. -- Thomas Herve From theller at python.net Wed Feb 25 14:12:10 2004 From: theller at python.net (Thomas Heller) Date: Wed Feb 25 14:12:41 2004 Subject: [python-win32] Re: py2exe 0.5 and WMI? References: Message-ID: "Stefan Holmgren" writes: > Hi, Thomas... > > I made this thing to work, but I don't think it's a nice way to solve it... > > .. At first I did a setup.py py2exe as below on my XP. > .. Then I opened the shared.zip and extracted all > 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' files > .. and renamed them to > 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1' > .. appended the new structur into the zip-file.. > .. In shared.zip I now got same files doubled > 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' and > 'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1' > > Hope u understand what I have done! > This is working for me.... > /Holmis Stefan, I thought of this: Assuming you want to create the exe on the XP machine: Go to the win2k machine, run your program there, and a folder named win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 should be created. This contains the makepy generated Python wrappers for version 1.1 of the wmi typelibs. Copy this folder to the XP machine, which should now have both the folders win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 and win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2 Now, change your setup script so that wrappers for both typelibs are included: options = {"py2exe": {"typelibs": # typelibs for WMI [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1), ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)], and build the exe by running the setup script. Now you should have an exe which should be able to run on both 2k and XP machines. Probably you did something having the same effect. Thomas From shitizb at yahoo.com Wed Feb 25 16:37:22 2004 From: shitizb at yahoo.com (Shitiz Bansal) Date: Wed Feb 25 16:37:27 2004 Subject: [python-win32] Automating IE Message-ID: <20040225213722.10449.qmail@web41503.mail.yahoo.com> Hi, CAn anybody explain me teh reason for this error and how to correct it from win32com.client import Dispatch ie = Dispatch('InternetExplorer.Application') ie.Visible = 1 ie.Navigate2('c:\\Civil.html') Traceback (most recent call last): File "", line 1, in -toplevel- ie.Navigate2('C:\\Civil.html') File "", line 2, in Navigate2 com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None) thanx in advance shitiz --------------------------------- Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040225/e12b39b5/attachment.html From shitizb at yahoo.com Wed Feb 25 16:38:56 2004 From: shitizb at yahoo.com (Shitiz Bansal) Date: Wed Feb 25 16:40:40 2004 Subject: [python-win32] Printing a pdf file Message-ID: <20040225213856.56995.qmail@web41511.mail.yahoo.com> Hi, How do i print a pdf file programatically using python ? shitiz --------------------------------- Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040225/383a4e75/attachment.html From jens.jorgensen at tallan.com Wed Feb 25 17:03:35 2004 From: jens.jorgensen at tallan.com (Jens B. Jorgensen) Date: Wed Feb 25 17:05:56 2004 Subject: [python-win32] Automating IE In-Reply-To: <20040225213722.10449.qmail@web41503.mail.yahoo.com> References: <20040225213722.10449.qmail@web41503.mail.yahoo.com> Message-ID: <403D1BB7.7080205@tallan.com> I tried this on my computer navigating to a local URL and it worked just fine. No error and it brought up the page as expected. Can you tell us more about the context in which you're trying to invoke this? Shitiz Bansal wrote: > /Hi,/ > /CAn anybody explain me teh reason for this error and how to correct it/ > // > /from win32com.client import Dispatch > //ie = Dispatch('InternetExplorer.Application') > //ie.Visible = 1 > //ie.Navigate2('c:\\Civil.html')/ > / > Traceback (most recent call last): > File "", line 1, in -toplevel- > ie.Navigate2('C:\\Civil.html') > File "", line 2, in Navigate2 > com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, > 0, -2147467259), None)/ > > /thanx in advance/ > > /shitiz/ > ------------------------------------------------------------------------ > Do you Yahoo!? > Yahoo! Mail SpamGuard > > - Read only the mail you want. > >------------------------------------------------------------------------ > >_______________________________________________ >Python-win32 mailing list >Python-win32@python.org >http://mail.python.org/mailman/listinfo/python-win32 > > -- Jens B. Jorgensen jens.jorgensen@tallan.com "With a focused commitment to our clients and our people, we deliver value through customized technology solutions." From shitizb at yahoo.com Thu Feb 26 01:54:22 2004 From: shitizb at yahoo.com (Shitiz Bansal) Date: Thu Feb 26 01:54:25 2004 Subject: [python-win32] Automating IE In-Reply-To: Message-ID: <20040226065422.83001.qmail@web41501.mail.yahoo.com> Hi, Thanx, ur code worked out. However it didnt solve my problem. Actually I was trying to print a pdf file programatically and copied the following code from internet from win32com.client import Dispatch ie = Dispatch('InternetExplorer.Application') ie.Visible = 1 ie.Navigate2('c:\\dscV1.pdf') pdfViewer = ie.Document.embeds[0] pdfViewer.Print() The code works, but the trouble is it opens up the printerdialog. I want the printing without any user intervention with preset print options. Is there a way out? Shitiz Janez Jere wrote: try: ie.Navigate2(url, 1, "_BLANK") i just copied from one of working scripts. but i dont remember why there are two additional params Janez -----Original Message----- From: python-win32-bounces+janez.jere=void.si@python.org [mailto:python-win32-bounces+janez.jere=void.si@python.org]On Behalf Of Shitiz Bansal Sent: Wednesday, February 25, 2004 10:37 PM To: python-win32@python.org Subject: [python-win32] Automating IE Hi, CAn anybody explain me teh reason for this error and how to correct it from win32com.client import Dispatch ie = Dispatch('InternetExplorer.Application') ie.Visible = 1 ie.Navigate2('c:\\Civil.html') Traceback (most recent call last): File "", line 1, in -toplevel- ie.Navigate2('C:\\Civil.html') File "", line 2, in Navigate2 com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None) thanx in advance shitiz --------------------------------- Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. --------------------------------- Do you Yahoo!? Get better spam protection with Yahoo! Mail -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040225/e94af981/attachment.html From tim.golden at viacom-outdoor.co.uk Thu Feb 26 03:38:04 2004 From: tim.golden at viacom-outdoor.co.uk (Tim Golden) Date: Thu Feb 26 03:38:25 2004 Subject: [python-win32] Automating IE Message-ID: Shitiz Bansal [mailto:shitizb@yahoo.com] > Hi, > Thanx, ur code worked out. > However it didnt solve my problem. > Actually I was trying to print a pdf file > programatically and copied the following code from internet [... snip code ...] If all you're trying to do is to to print from Acrobat, then (at least on Acro4) you can call the reader executable (acrord32.exe) you can pass a command-line switch of /p, meaning print, or /t, meaning print to default printer. However, I believe that these switches are being deprecated in later versions, so your mileage may vary. Example: "c:\program files\adobe\Acrobat 4.0\Reader\acrord32.exe" /p doc.pdf TJG ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. 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 ________________________________________________________________________ From theller at python.net Thu Feb 26 04:25:52 2004 From: theller at python.net (Thomas Heller) Date: Thu Feb 26 04:26:27 2004 Subject: [python-win32] Re: Automating IE References: Message-ID: Tim Golden writes: > Shitiz Bansal [mailto:shitizb@yahoo.com] > >> Hi, >> Thanx, ur code worked out. >> However it didnt solve my problem. >> Actually I was trying to print a pdf file >> programatically and copied the following code from internet > > [... snip code ...] > > If all you're trying to do is to to print from Acrobat, > then (at least on Acro4) you can call the reader executable > (acrord32.exe) you can pass a command-line switch of /p, > meaning print, or /t, meaning print to default printer. > > However, I believe that these switches are being deprecated > in later versions, so your mileage may vary. > > Example: > > "c:\program files\adobe\Acrobat 4.0\Reader\acrord32.exe" /p doc.pdf > Or, call ShellExecute directly. from ctypes import * windll.shell32.ShellExecuteA(None, "print", "doc.pdf", None, None, 0) See also: Thomas From tim.golden at viacom-outdoor.co.uk Thu Feb 26 04:31:08 2004 From: tim.golden at viacom-outdoor.co.uk (Tim Golden) Date: Thu Feb 26 04:43:54 2004 Subject: [python-win32] Re: Automating IE Message-ID: >-----Original Message----- >From: Thomas Heller [mailto:theller@python.net] >Sent: 26 February 2004 09:26 >To: python-win32@python.org >Subject: [python-win32] Re: Automating IE > > >Tim Golden writes: > >> Shitiz Bansal [mailto:shitizb@yahoo.com] >> >>> Hi, >>> Thanx, ur code worked out. >>> However it didnt solve my problem. >>> Actually I was trying to print a pdf file >>> programatically and copied the following code from internet >> >> [... snip code ...] >> >> If all you're trying to do is to to print from Acrobat, >> then (at least on Acro4) you can call the reader executable >> (acrord32.exe) you can pass a command-line switch of /p, >> meaning print, or /t, meaning print to default printer. >> >> However, I believe that these switches are being deprecated >> in later versions, so your mileage may vary. >> >> Example: >> >> "c:\program files\adobe\Acrobat 4.0\Reader\acrord32.exe" /p doc.pdf >> > >Or, call ShellExecute directly. > >from ctypes import * >windll.shell32.ShellExecuteA(None, "print", "doc.pdf", None, None, 0) > >See also: > Thomas Funnily enough, I had that same idea about 10 seconds after I sent the email, but decided not to clutter the list up with more of my ramblings. Oops. I've done it anyway. TJG ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. 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 ________________________________________________________________________ From theller at python.net Thu Feb 26 04:52:50 2004 From: theller at python.net (Thomas Heller) Date: Thu Feb 26 04:53:22 2004 Subject: [python-win32] Re: Automating IE References: Message-ID: [Tim] >>> Example: >>> >>> "c:\program files\adobe\Acrobat 4.0\Reader\acrord32.exe" /p doc.pdf >>> >> [Thomas] >>Or, call ShellExecute directly. >> >>from ctypes import * >>windll.shell32.ShellExecuteA(None, "print", "doc.pdf", None, None, 0) >> >>See also: >> [Tim] > > Funnily enough, I had that same idea about 10 seconds after I > sent the email, but decided not to clutter the list up with > more of my ramblings. > Oops. I've done it anyway. If ctypes wouldn't have been invented, I would propose that os.startfile(path) should take an optional second argument allowing to specify 'open', 'print', or whatever. Thomas From bgailer at alum.rpi.edu Thu Feb 26 15:58:13 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Thu Feb 26 15:58:03 2004 Subject: [python-win32] Python Win broken again Message-ID: <6.0.0.22.0.20040226135335.038f5fb0@mail.mric.net> I threw Win 2003 out the window, and am running Win 2000 Advanced server. Python Win performed OK until today; now it is degrading rapidly. I am using Word 2000 and Visual FoxPro 8 as COM objects. It ran OK for a little time, now has various symptoms as giving errors on trying to step into a module in the debugger, and menus and tool bar buttons failing to operate. Rebooting has no effect. I am VERY discouraged, as I have depended on this tool for over a year to do my work, and now I continue to be unable to do my work. Sigh. Is there something I need to do differently, or something I need to avoid? Can ANYONE help? Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From jkreps at rev.state.ne.us Thu Feb 26 16:10:30 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Thu Feb 26 16:20:04 2004 Subject: [python-win32] Python Win broken again Message-ID: Bob, I haven't used PythonWin... I am running Win2K with all the latest patches on a DELL Optiplex GX260, using the GUI RAD dev tool called Boa_constructor (v0.2.3) on top of wxPython + wxWindows 2.4.2.4 on top of Python 2.3.2. The backend is Oracle and the ODBC is mxODBC. I use py2exe to generate an exe. I've been using this tool combo for about 4 months without any problems. I am testing this combo as a tool to generate exe's for use inhouse. What kind of error msgs do you get when you use something like the following?: try: ...some button event code... except: err = sys.exc_info()[:2] print "exception: ", sys.exc_info()[:2] ============ JLK http://www.linuxiso.org/viewdoc.php/introtolinux.html Bob Gailer cc: Sent by: Subject: [python-win32] Python Win broken again python-win32-bounces @python.org 02/26/2004 02:58 PM I threw Win 2003 out the window, and am running Win 2000 Advanced server. Python Win performed OK until today; now it is degrading rapidly. I am using Word 2000 and Visual FoxPro 8 as COM objects. It ran OK for a little time, now has various symptoms as giving errors on trying to step into a module in the debugger, and menus and tool bar buttons failing to operate. Rebooting has no effect. I am VERY discouraged, as I have depended on this tool for over a year to do my work, and now I continue to be unable to do my work. Sigh. Is there something I need to do differently, or something I need to avoid? Can ANYONE help? Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 From pyama at snafu.de Fri Feb 27 06:25:42 2004 From: pyama at snafu.de (Andreas Maurer) Date: Fri Feb 27 06:25:46 2004 Subject: [python-win32] py2exe Probs with Visual SourceSafe TLB Message-ID: Hi everybody, I've written a little script using the Visual SourceSafe automation lib. I've also accoplished the makepy utility for this lib. When I'm running the script with the common python interpreter also works fine. When I compile it, I Get some problems with some VSS Attributes like: Traceback (most recent call last): File "get_VSS.py", line 150, in ? SSTopLevelPrj = SSTopLevelPrj.GetVersion(VSSVer) File "win32com\client\dynamic.pyo", line 477, in __getattr__ AttributeError: VSSItem.GetVersion The GetVersion-attrib doesn't appear in "normal" SourceSafe. Python (makepy) will change the Version get property to the GetVersion method. Any way, the same problem I see with constants like constants.VSSFILE_... How can I tell the py2exe compiler to use this things? Some description of my environment: Python: ver. 2.3.3 py2exe: ver. 0.5.0 win32all: build 200 os: W2k with SP3 Thank you for any help Andi From bgailer at alum.rpi.edu Fri Feb 27 08:15:12 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Fri Feb 27 08:15:00 2004 Subject: [python-win32] More details of Python Win degredation Message-ID: <6.0.0.22.0.20040227060804.03872648@mail.mric.net> What I see: Python Win loads very slowly. On debugging I get a LoadBarState failed - LoadBarState failed (with win32 exception!). Returning later and trying to open a file I get: File "L:\Python23\lib\site-packages\Pythonwin\pywin\mfc\docview.py", line 91, in CreateNewFrame wnd.LoadFrame(self.GetResourceID(), -1, None, context) # triggers OnCreateClient... win32ui: LoadFrame failed win32ui: CreateNewFrame() virtual handler (>) raised an exception TypeError: PyCTemplate::CreateNewFrame must return a PyCFrameWnd object. Going into debug - first the 3 extra debugger windows appear. Starting a 2nd debugging gives: LoadBarState failed - LoadBarState failed (with win32 exception!) and the 3 windows do not appear. I am really sad and frustrated, because I have used Python Win for over a year with great success. I love it. I do not know what I will replace it with, but as of now it does not work. All my other Windows programs seem to work fine. (MS Word, FoxPro, etc). Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From amonroe at columbus.rr.com Fri Feb 27 08:29:28 2004 From: amonroe at columbus.rr.com (R. Alan Monroe) Date: Fri Feb 27 08:24:04 2004 Subject: [python-win32] More details of Python Win degredation In-Reply-To: <6.0.0.22.0.20040227060804.03872648@mail.mric.net> References: <6.0.0.22.0.20040227060804.03872648@mail.mric.net> Message-ID: <1871941181441.20040227082928@columbus.rr.com> > What I see: > Python Win loads very slowly. > On debugging I get a LoadBarState failed - LoadBarState failed (with win32 > exception!). It's a longshot, but try running Sysinternals Filemon and/or Regmon to see what your programs are doing in the background. Those have helped me troubleshoot loads of problems. Alan From jkreps at rev.state.ne.us Fri Feb 27 09:09:43 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Fri Feb 27 09:12:39 2004 Subject: [python-win32] py2exe Probs with Visual SourceSafe TLB Message-ID: setup.py ************************************** from distutils.core import setup import py2exe setup(name="anyname", description="Python Version of anyname", version='1.0', windows=["anyname.py",], data_files=[("/full/path/to/gif",["RPTLOGO2.gif",]), ("/full/path/to/data",["datafile1","datafile2","datafile3",])] ) ************************************************************ Andreas Maurer Sent by: To: python-win32@python.org python-win32-bounces+jkreps=rev.state.ne.us cc: @python.org Subject: [python-win32] py2exe Probs with Visual SourceSafe TLB 02/27/2004 05:25 AM Hi everybody, I've written a little script using the Visual SourceSafe automation lib. I've also accoplished the makepy utility for this lib. When I'm running the script with the common python interpreter also works fine. When I compile it, I Get some problems with some VSS Attributes like: Traceback (most recent call last): File "get_VSS.py", line 150, in ? SSTopLevelPrj = SSTopLevelPrj.GetVersion(VSSVer) File "win32com\client\dynamic.pyo", line 477, in __getattr__ AttributeError: VSSItem.GetVersion The GetVersion-attrib doesn't appear in "normal" SourceSafe. Python (makepy) will change the Version get property to the GetVersion method. Any way, the same problem I see with constants like constants.VSSFILE_... How can I tell the py2exe compiler to use this things? Some description of my environment: Python: ver. 2.3.3 py2exe: ver. 0.5.0 win32all: build 200 os: W2k with SP3 Thank you for any help Andi _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 From pyama at snafu.de Fri Feb 27 09:15:03 2004 From: pyama at snafu.de (Andreas Maurer) Date: Fri Feb 27 09:15:11 2004 Subject: [python-win32] Found how to use TLBs with py2exe, anyhow problems Message-ID: Hi there, finding in the py2exe Wiki how to import TLBs in py2exe, it still doesn't work. This traceback will appear: --- running py2exe *** generate typelib stubs *** Traceback (most recent call last): File "setupget_VSS.py", line 48, in ? console = [r"H:\Ablagen\py\Versionierung\get_VSS.py"], File "C:\PROGRA~1\Python23\Lib\distutils\core.py", line 149, in setup dist.run_commands() File "C:\PROGRA~1\Python23\Lib\distutils\dist.py", line 907, in run_commands self.run_command(cmd) File "C:\PROGRA~1\Python23\Lib\distutils\dist.py", line 927, in run_command cmd_obj.run() File "C:\PROGRA~1\Python23\Lib\site-packages\py2exe\build_exe.py", line 180, in run self.typelibs) File "C:\PROGRA~1\Python23\Lib\site-packages\py2exe\build_exe.py", line 1061, in collect_win32 com_genpy sub_mod = gencache..GetModuleForCLSID(clsid) File "C:\PROGRA~1\Python23\Lib\site-packages\win32com\client\gencache.py", line 240, in GetMod uleForCLSID makepy.GenerateChildFromTypeLibSpec(sub_mod, info) File "C:\PROGRA~1\Python23\Lib\site-packages\win32com\client\makepy.py", line 306, in Generate ChildFromTypeLibSpec __import__("win32com.gen_py." + dir_name + "." + child) File "H:\Ablagen\py\Setups\build\bdist.win32 \winexe\temp\win32com\gen_py\783CD4E0-9D54-11CF-B8EE-00608CC9A71Fx0x5x1 \IVSSDatabase.py", line 27, in ? class IVSSDatabase(DispatchBaseClass): NameError: name 'DispatchBaseClass' is not defined --- In the setup file options are set in this way: opts = { "py2exe": { "optimize": "2", "dist_dir": r"H:\Ablagen\py\Versionierung\bin", "typelibs": [('{783CD4E0-9D54-11CF-B8EE-00608CC9A71F}', 0, 5, 1)], } } Again, the environment: Python: 2.3.3 py2exe: 0.5.0 OS: W2K SP3 win32all: build 200 Regards Andi From jkreps at rev.state.ne.us Fri Feb 27 09:13:23 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Fri Feb 27 09:16:11 2004 Subject: [python-win32] More details of Python Win degredation Message-ID: Have you tried reverting to a previous release? You could always give Boa_constructor a shot. It works great for me on the same platform you are using. ============ JLK http://www.linuxiso.org/viewdoc.php/introtolinux.html Bob Gailer cc: Sent by: Subject: [python-win32] More details of Python Win python-win32-bounces degredation @python.org 02/27/2004 07:15 AM What I see: Python Win loads very slowly. On debugging I get a LoadBarState failed - LoadBarState failed (with win32 exception!). Returning later and trying to open a file I get: File "L:\Python23\lib\site-packages\Pythonwin\pywin\mfc\docview.py", line 91, in CreateNewFrame wnd.LoadFrame(self.GetResourceID(), -1, None, context) # triggers OnCreateClient... win32ui: LoadFrame failed win32ui: CreateNewFrame() virtual handler (>) raised an exception TypeError: PyCTemplate::CreateNewFrame must return a PyCFrameWnd object. Going into debug - first the 3 extra debugger windows appear. Starting a 2nd debugging gives: LoadBarState failed - LoadBarState failed (with win32 exception!) and the 3 windows do not appear. I am really sad and frustrated, because I have used Python Win for over a year with great success. I love it. I do not know what I will replace it with, but as of now it does not work. All my other Windows programs seem to work fine. (MS Word, FoxPro, etc). Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 From Christian.Wyglendowski at greenville.edu Fri Feb 27 09:19:09 2004 From: Christian.Wyglendowski at greenville.edu (Christian Wyglendowski) Date: Fri Feb 27 09:19:13 2004 Subject: [python-win32] More details of Python Win degredation Message-ID: > -----Original Message----- > From: python-win32-bounces@python.org > [mailto:python-win32-bounces@python.org] On Behalf Of R. Alan Monroe > Sent: Friday, February 27, 2004 7:29 AM > To: python-win32@python.org > Subject: Re: [python-win32] More details of Python Win degredation > > > > What I see: > > Python Win loads very slowly. > > On debugging I get a LoadBarState failed - LoadBarState > failed (with > > win32 exception!). > > It's a longshot, but try running Sysinternals Filemon and/or > Regmon to see what your programs are doing in the background. > Those have helped me troubleshoot loads of problems. > > Alan Here's another long shot, but since this has just started happening recently (I assume the same machine with Server 2003 and now Win2k?), it could be a hardware issue. You might try running the Prime95 torture test over night. It will stress test your CPU and memory and if any errors occur, you know you have a problem with your hardware. Here is the link: http://www.mersenne.org/freesoft.htm Christian http://www.dowski.com From theller at python.net Fri Feb 27 09:50:18 2004 From: theller at python.net (Thomas Heller) Date: Fri Feb 27 09:51:20 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, anyhow problems References: Message-ID: Andreas Maurer writes: Andreas Maurer writes: > finding in the py2exe Wiki how to import TLBs in py2exe, it still > doesn't work. > > In the setup file options are set in this way: > > opts = { > "py2exe": { > "optimize": "2", > "dist_dir": r"H:\Ablagen\py\Versionierung\bin", > "typelibs": [('{783CD4E0-9D54-11CF-B8EE-00608CC9A71F}', 0, 5, 1)], > } > } Looks ok, that's the way to do it (assuming you got the typelib id right). > This traceback will appear: > --- > running py2exe > *** generate typelib stubs *** > Traceback (most recent call last): > File "setupget_VSS.py", line 48, in ? > console = [r"H:\Ablagen\py\Versionierung\get_VSS.py"], > File "C:\PROGRA~1\Python23\Lib\distutils\core.py", line 149, in setup > dist.run_commands() > File "C:\PROGRA~1\Python23\Lib\distutils\dist.py", line 907, in run_commands > self.run_command(cmd) > File "C:\PROGRA~1\Python23\Lib\distutils\dist.py", line 927, in run_command > cmd_obj.run() > File "C:\PROGRA~1\Python23\Lib\site-packages\py2exe\build_exe.py", line 180, > in run > self.typelibs) > File "C:\PROGRA~1\Python23\Lib\site-packages\py2exe\build_exe.py", line 1061, > in collect_win32 > com_genpy > sub_mod = gencache..GetModuleForCLSID(clsid) > File "C:\PROGRA~1\Python23\Lib\site-packages\win32com\client\gencache.py", > line 240, in GetMod > uleForCLSID > makepy.GenerateChildFromTypeLibSpec(sub_mod, info) > File "C:\PROGRA~1\Python23\Lib\site-packages\win32com\client\makepy.py", line > 306, in Generate > ChildFromTypeLibSpec > __import__("win32com.gen_py." + dir_name + "." + child) > File "H:\Ablagen\py\Setups\build\bdist.win32 > \winexe\temp\win32com\gen_py\783CD4E0-9D54-11CF-B8EE-00608CC9A71Fx0x5x1 > \IVSSDatabase.py", line 27, in ? > class IVSSDatabase(DispatchBaseClass): > NameError: name 'DispatchBaseClass' is not defined > --- And this looks like you could try to debug this yourself. Can you try? Thomas From amonroe at columbus.rr.com Fri Feb 27 10:03:49 2004 From: amonroe at columbus.rr.com (R. Alan Monroe) Date: Fri Feb 27 09:58:27 2004 Subject: [python-win32] More details of Python Win degredation In-Reply-To: References: Message-ID: <1431946842831.20040227100349@columbus.rr.com> >> > What I see: >> > Python Win loads very slowly. >> > On debugging I get a LoadBarState failed - LoadBarState >> failed (with >> > win32 exception!). >> It's a longshot, but try running Sysinternals Filemon and/or >> Regmon to see what your programs are doing in the background. >> Those have helped me troubleshoot loads of problems. > Here's another long shot, but since this has just started happening > recently (I assume the same machine with Server 2003 and now Win2k?), it > could be a hardware issue. You might try running the Prime95 torture > test over night. It will stress test your CPU and memory and if any > errors occur, you know you have a problem with your hardware. Here is > the link: > http://www.mersenne.org/freesoft.htm Good idea. Also try http://www.memtest86.com/ Alan From Benjamin.Schollnick at usa.xerox.com Fri Feb 27 10:02:03 2004 From: Benjamin.Schollnick at usa.xerox.com (Schollnick, Benjamin) Date: Fri Feb 27 10:06:04 2004 Subject: [python-win32] PyCrypto v1.9a6 Message-ID: <51B62EFFBC83D6118ADA00096BB030A107CADDDE@usamcms7.mc.usa.xerox.com> Folks, I am attempting to install the Pycrypto v1.9a6 software, I believe that Twisted (www.twistedmatrix.com) requires it for the SSH features... (The sad thing is that I'm running through all these hoops simply because I need to be able to make a SSH connection, and be able to read and write to the stream... (ala Telnetlib)) when I: setup.py install I receive: C:\develope\pycrypto-1.9a6>setup.py install running install running build running build_py running build_ext error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. Now I am running: C:\develope\pycrypto-1.9a6>python Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> I also have win32-157 installed.... Is there some way around this compile issue, does anyone know of a precompiled Windows binary for the PyCrypto kit?? - Benjamin From pyama at snafu.de Fri Feb 27 10:16:18 2004 From: pyama at snafu.de (pyama@snafu.de) Date: Fri Feb 27 10:16:21 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, Message-ID: > Andreas Maurer writes: > > .... > > ChildFromTypeLibSpec > > __import__("win32com.gen_py." + dir_name + "." + child) > > File "H:\Ablagen\py\Setups\build\bdist.win32 > > \winexe\temp\win32com\gen_py\783CD4E0-9D54-11CF-B8EE-00608CC9A71Fx0x5x1 > > \IVSSDatabase.py", line 27, in ? > > class IVSSDatabase(DispatchBaseClass): > > NameError: name 'DispatchBaseClass' is not defined > > --- > > And this looks like you could try to debug this yourself. Can you try? I've tried. When I had found the reason why this exception raises I barely didn't post in this group. > > Thomas > Andi From theller at python.net Fri Feb 27 10:49:28 2004 From: theller at python.net (Thomas Heller) Date: Fri Feb 27 10:49:33 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, References: Message-ID: pyama@snafu.de writes: >> Andreas Maurer writes: >> >> > > .... > >> > ChildFromTypeLibSpec >> > __import__("win32com.gen_py." + dir_name + "." + child) >> > File "H:\Ablagen\py\Setups\build\bdist.win32 >> > \winexe\temp\win32com\gen_py\783CD4E0-9D54-11CF-B8EE-00608CC9A71Fx0x5x1 >> > \IVSSDatabase.py", line 27, in ? >> > class IVSSDatabase(DispatchBaseClass): >> > NameError: name 'DispatchBaseClass' is not defined >> > --- >> >> And this looks like you could try to debug this yourself. Can you try? > > I've tried. When I had found the reason why this exception raises > I barely didn't post in this group. I don't have VSS installed (shudder), I use CVS ;-) Can you mail me the typelib for vss, or zip up the temp\win32com\gen_py\783CD4E0-9D54-11CF-B8EE-00608CC9A71Fx0x5x1 folder and mail this (in private email) ? Thomas From jkreps at rev.state.ne.us Fri Feb 27 10:54:11 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Fri Feb 27 10:56:58 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, Message-ID: "I don't have VSS installed (shudder), I use CVS ;-)" CVS is sweet, fast and stable. I'm using CVSNT as a local service and my front end is WinCVS. But, most of my CVS work I do through TortoiseCVS, which is embedded in the menu options of Windows Explorer. A couple of right mouse clicks on the project folder or selected files is all it takes. Pardon my curiosity, but how and with what are you using CVS? JLK From theller at python.net Fri Feb 27 12:03:28 2004 From: theller at python.net (Thomas Heller) Date: Fri Feb 27 12:11:08 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, References: Message-ID: pyama@snafu.de writes: >> Andreas Maurer writes: >> >> > > .... > >> > ChildFromTypeLibSpec >> > __import__("win32com.gen_py." + dir_name + "." + child) >> > File "H:\Ablagen\py\Setups\build\bdist.win32 >> > \winexe\temp\win32com\gen_py\783CD4E0-9D54-11CF-B8EE-00608CC9A71Fx0x5x1 >> > \IVSSDatabase.py", line 27, in ? >> > class IVSSDatabase(DispatchBaseClass): >> > NameError: name 'DispatchBaseClass' is not defined >> > --- >> >> And this looks like you could try to debug this yourself. Can you try? > > I've tried. When I had found the reason why this exception raises > I barely didn't post in this group. > Here's a hint. When I look into one of the subdirectories of win32com\gen_py, I find code like this (line 27) from win32com.client import DispatchBaseClass (line 28) class ISWbemServicesEx(DispatchBaseClass): The traceback you posted above suggests that the 'from ... import DispatchBaseClass' line is missing in the module in your system, or for another reason DispatchBaseClass is not defined. Take a look into that file and report what you find there - that's what I would have done if I were you. Thomas From glc at well.com Fri Feb 27 12:06:19 2004 From: glc at well.com (Greg Chapman) Date: Fri Feb 27 12:21:03 2004 Subject: [python-win32] Re: More details of Python Win degredation References: <6.0.0.22.0.20040227060804.03872648@mail.mric.net> Message-ID: On Fri, 27 Feb 2004 06:15:12 -0700, Bob Gailer wrote: >What I see: > >Python Win loads very slowly. > >On debugging I get a LoadBarState failed - LoadBarState failed (with win32 >exception!). > I ran into this earlier this year: http://mail.python.org/pipermail/python-win32/2004-January/001497.html http://mail.python.org/pipermail/python-win32/2004-January/001499.html To be more specific, the registry folder I referred to is: HKCU\Software\Python 2.3\Python for Win32 I still don't know why this happened, but it hasn't happened again for me. --- Greg Chapman From theller at python.net Fri Feb 27 11:48:59 2004 From: theller at python.net (Thomas Heller) Date: Fri Feb 27 12:30:37 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, References: Message-ID: <8yiolb7o.fsf@python.net> jkreps@rev.state.ne.us writes: > "I don't have VSS installed (shudder), I use CVS ;-)" > > CVS is sweet, fast and stable. I guess that subversion is better, nowadays. But I don't have experience with it. > I'm using CVSNT as a local service and my front end is WinCVS. But, most I'm using repositories on linux servers, either via pserver or ssh. And sometimes local files on nt servers. > of my CVS work I do through TortoiseCVS, which is embedded in the menu > options of Windows Explorer. A couple of right mouse clicks on the > project folder or selected files is all it takes. TortoiseCVS is nice, but I don't like WinCVS. Normally I use either command line cvs from the command prompt, or pcl-cvs from inside XEmacs. No couple of mouse clicks required - you can lease the hands where they belong. > Pardon my curiosity, but how and with what are you using CVS? > > JLK Thomas From shitizb at yahoo.com Fri Feb 27 13:29:08 2004 From: shitizb at yahoo.com (Shitiz Bansal) Date: Fri Feb 27 13:29:15 2004 Subject: [python-win32] Print query in python Message-ID: <20040227182908.36369.qmail@web41508.mail.yahoo.com> Hi, How do i query my printer about particular print jobs and their details using python or command line options? Can anybody tell me which package to use? Thanx in advance Shitiz --------------------------------- Do you Yahoo!? Get better spam protection with Yahoo! Mail -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-win32/attachments/20040227/082dbb0a/attachment.html From jkreps at rev.state.ne.us Fri Feb 27 13:31:18 2004 From: jkreps at rev.state.ne.us (jkreps@rev.state.ne.us) Date: Fri Feb 27 13:34:13 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, Message-ID: Thomas Heller To: python-win32@python.org Sent by: cc: python-win32-bounces Subject: [python-win32] Re: Found how to use TLBs with @python.org py2exe, 02/27/2004 10:48 AM jkreps@rev.state.ne.us writes: >> "I don't have VSS installed (shudder), I use CVS ;-)" >> >> CVS is sweet, fast and stable. >I guess that subversion is better, nowadays. But I don't have >experience with it. I looked at Subversion about a year ago, but it wasn't ready for primetime then. With your memory jog I just went out to its website and discovered that they released 1.0 last Monday, so I will certainly be giving it another run-through. I noticed that the site also has links to TortoiseSVN. .... >> of my CVS work I do through TortoiseCVS, which is embedded in the menu >> options of Windows Explorer. A couple of right mouse clicks on the >> project folder or selected files is all it takes. >TortoiseCVS is nice, but I don't like WinCVS. >Normally I use either command line cvs from the command prompt, >or pcl-cvs from inside XEmacs. No couple of mouse clicks required - you >can lease the hands where they belong. mmm... I'm not a power-user but I know one when I meet one, and anyone who uses XEmacs is one. I tried Emacs/XEmacs when I first got into Linux about a few years ago. I'm 63 and I decided that with my advancing C-Nile virus condition I wouldn't learn/retain enough about XEmac to become a power-user before I died. I don't even use the commandline of CVS, opting instead for the mouse and macros, so I am a real weenie. :-) Thanks for the heads up about Subversion! JLK _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 From yakumoklesk at yahoo.es Fri Feb 27 14:07:14 2004 From: yakumoklesk at yahoo.es (yakumoklesk@yahoo.es) Date: Fri Feb 27 14:07:09 2004 Subject: [python-win32] Python debug memory leaks Message-ID: <403FA372.15061.173E287F@localhost> I don't know if I have to write to this list or to python-byg mailing list to get a solutions to this problem. I am embedding the python interpreter in my Visual C++ 6.0 application. I am running debug versions of python (python_d.lib + python_d.dll) because I also want to import debug DLL versions of C++ wrapped libraries made with SWIG. But when I do PyInitialize() and then I follow it with PyFinalize() and end the program, the VC environment reports memory leaks. I use library and _CrtSetBreakAlloc() function to stop when the memory block that was reported to be leaked is allocated, and it is allocated from inside python code. Is there a patch to solve this in the debug version of Python 2.3 which I am using. I need to get 0 memory leaks from python because I can easily distinguish my own memory leaks in my code and in the wrapped C++ classed made with SWIG. Thanks in advance. David. From stefan_holmgren at msn.com Fri Feb 27 15:44:20 2004 From: stefan_holmgren at msn.com (S.Holmgren) Date: Fri Feb 27 15:50:35 2004 Subject: [python-win32] Re: py2exe 0.5 and WMI? In-Reply-To: References: Message-ID: Thomas Heller wrote: > "Stefan Holmgren" writes: > > >>Hi, Thomas... >> >>I made this thing to work, but I don't think it's a nice way to solve it... >> >>.. At first I did a setup.py py2exe as below on my XP. >>.. Then I opened the shared.zip and extracted all >>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' files >>.. and renamed them to >>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1' >>.. appended the new structur into the zip-file.. >>.. In shared.zip I now got same files doubled >>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' and >>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1' >> >>Hope u understand what I have done! >>This is working for me.... >>/Holmis > > > Stefan, I thought of this: > > Assuming you want to create the exe on the XP machine: > > Go to the win2k machine, run your program there, and a folder named > win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 > should be created. This contains the makepy generated Python wrappers > for version 1.1 of the wmi typelibs. > > Copy this folder to the XP machine, which should now have both the > folders > win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 > and > win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2 > > Now, change your setup script so that wrappers for both typelibs are > included: > options = {"py2exe": {"typelibs": > # typelibs for WMI > [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1), > ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)], > and build the exe by running the setup script. > > Now you should have an exe which should be able to run on both 2k and XP > machines. > > Probably you did something having the same effect. > > Thomas Hi again.... ok, Thomas thanks for your fast reply and support, but... py2exe don't like your ide.... I copied the folder: win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 from 2k to my XP machine.. I now got these 2 folders under win32com\gen_py\ py2exe says: Traceback (most recent call last): File "C:\MyProgs\Python\SHtimer\setup.py", line 155, in ? windows = [test_wx], File "C:\Python23\lib\distutils\core.py", line 149, in setup dist.run_commands() File "C:\Python23\lib\distutils\dist.py", line 907, in run_commands self.run_command(cmd) File "C:\Python23\lib\distutils\dist.py", line 927, in run_command cmd_obj.run() File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 180, in run self.typelibs) File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 1058, in collec t_win32com_genpy mod = gencache.GetModuleForTypelib(*info) File "C:\Python23\lib\site-packages\win32com\client\gencache.py", line 250, in GetModuleForTypelib mod = _GetModule(modName) File "C:\Python23\lib\site-packages\win32com\client\gencache.py", line 616, in _GetModule mod = __import__(mod_name) ImportError: No module named 565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1 ok...I can use my solution to modify the the shared.zip after I have made a dist with py2exe.... / Holmis From pyama at snafu.de Sat Feb 28 08:07:01 2004 From: pyama at snafu.de (Andreas Maurer) Date: Sat Feb 28 08:08:59 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, In-Reply-To: References: Message-ID: <40409275.90500@snafu.de> jkreps@rev.state.ne.us schrieb: > "I don't have VSS installed (shudder), I use CVS ;-)" > > CVS is sweet, fast and stable. All this properties -in our context- does have VSS also. Is CVS also shipped with an COM Automation Library? [ -- cut -- ] > Pardon my curiosity, but how and with what are you using CVS? Thats the policy of the company. I neither want to, nor I have the mighty to change it. VSS works and has a nice Automation Lib. My favorite is ClearCase. ClearCase alse shipps with an great Automation Lib which works fine together with Python (with *NO* problems while compiling ;-)) > JLK Andi From koliphant at qwest.net Sat Feb 28 12:00:24 2004 From: koliphant at qwest.net (Kerry Oliphant) Date: Sat Feb 28 14:41:02 2004 Subject: [python-win32] OleLoadPicture PyIStream and Resource files Message-ID: I am using OleLoadPicture to assign bitmaps to an ImageList control. However, right now I have to load each bitmap from a file and write the data to an PyIStream object. I would like to be able to just get the bitmaps from a loaded resource DLL to write to the PyIStream object. Does anyone know how to do this? Kerry From bgailer at alum.rpi.edu Sat Feb 28 14:53:21 2004 From: bgailer at alum.rpi.edu (Bob Gailer) Date: Sat Feb 28 14:53:01 2004 Subject: [python-win32] Re: More details of Python Win degredation In-Reply-To: References: <6.0.0.22.0.20040227060804.03872648@mail.mric.net> Message-ID: <6.0.0.22.0.20040228125218.026c5580@mail.mric.net> A follow-up to my previous complaint. I reverted to Python 2.3.3 and Win32All 162. So far things look good. Bob Gailer bgailer@alum.rpi.edu 303 442 2625 home 720 938 2625 cell From rasjidw at openminddev.net Sun Feb 29 01:19:47 2004 From: rasjidw at openminddev.net (Rasjid Wilcox) Date: Sun Feb 29 01:17:10 2004 Subject: [python-win32] Re: Found how to use TLBs with py2exe, In-Reply-To: References: Message-ID: <200402291719.47729.rasjidw@openminddev.net> On Saturday 28 February 2004 05:31, jkreps@rev.state.ne.us wrote: > I don't even use the commandline of CVS, opting instead > for the mouse and macros, so I am a real weenie. :-) If you are using CVS on Windows (or any java supported platform for that matter), I can also highly recommend SmartCVS. It is the only Java based GUI program I use on a regular basis. Cheers, Rasjid. -- Rasjid Wilcox Canberra, Australia (UTC +11 hrs) http://www.openminddev.net