From timr at probo.com Thu May 1 18:46:38 2008 From: timr at probo.com (Tim Roberts) Date: Thu, 01 May 2008 09:46:38 -0700 Subject: [python-win32] Help about printing In-Reply-To: <481705CE.9010300@bertayjavi.com> References: <4816D36B.6060705@bertayjavi.com> <481705CE.9010300@bertayjavi.com> Message-ID: <4819F3EE.8010802@probo.com> Javi wrote: > Hello, i use python 2.5, and wx, i'm trying to print a bitmap with > transparency background but it doesnt print right, i just get a > preview right but when i printed it, bitmap transparency background > is printed on black. I dont know why , but i need to print it right. > All help will be welcome. Thanks. > > P.D: i tried to print the wxpython demo 2.8 and it happens the same, > transparency background is printed on black. Many printers do not handle transparency. What kind of printer is it? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mc at mclaveau.com Thu May 1 19:02:01 2008 From: mc at mclaveau.com (Michel Claveau) Date: Thu, 1 May 2008 19:02:01 +0200 Subject: [python-win32] Help about printing In-Reply-To: <4819F3EE.8010802@probo.com> References: <4816D36B.6060705@bertayjavi.com> <481705CE.9010300@bertayjavi.com> <4819F3EE.8010802@probo.com> Message-ID: <773A11EF827A4A60B23A26CDFD46BE8C@MCI1330> Hi! > Many printers do not handle transparency. What kind of printer is it? An invisible printer? ;-) Michel Claveau From timr at probo.com Thu May 1 19:38:27 2008 From: timr at probo.com (Tim Roberts) Date: Thu, 01 May 2008 10:38:27 -0700 Subject: [python-win32] Help about printing In-Reply-To: <773A11EF827A4A60B23A26CDFD46BE8C@MCI1330> References: <4816D36B.6060705@bertayjavi.com> <481705CE.9010300@bertayjavi.com> <4819F3EE.8010802@probo.com> <773A11EF827A4A60B23A26CDFD46BE8C@MCI1330> Message-ID: <481A0013.6060909@probo.com> Michel Claveau wrote: > Hi! > >> Many printers do not handle transparency. What kind of printer is it? > > An invisible printer? > ;-) Ironically, I often have the opposite problem. When my inkjet printer starts to run low, I find that it excels at printing transparent images, but neglects to print anything opaque. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From jsiegris at sbcglobal.net Thu May 1 19:48:47 2008 From: jsiegris at sbcglobal.net (John Siegrist) Date: Thu, 1 May 2008 10:48:47 -0700 (PDT) Subject: [python-win32] (no subject) Message-ID: <707664.99822.qm@web82104.mail.mud.yahoo.com> var YAHOO = {'Shortcuts' : {}}; YAHOO.Shortcuts.hasSensitiveText = true; YAHOO.Shortcuts.sensitivityType = ["sensitive_news_terms"]; YAHOO.Shortcuts.doUlt = false; YAHOO.Shortcuts.location = "us"; YAHOO.Shortcuts.document_id = 0; YAHOO.Shortcuts.document_type = ""; YAHOO.Shortcuts.document_title = "Automatic DLL loading behavior"; YAHOO.Shortcuts.document_publish_date = ""; YAHOO.Shortcuts.document_author = "kaizyn at sbcglobal.net"; YAHOO.Shortcuts.document_url = ""; YAHOO.Shortcuts.document_tags = ""; YAHOO.Shortcuts.annotationSet = { }; Hello All, Ihave a fairly straightforward script that attempts to connect to a webserver using https and retrieve some data which is then compared to afile retrieved out of subversion. To do these tasks, my script isusing M2Crypto 0.18.2 and PySVN 1.5.3-904. While these are onlyincidental to my problem, I thought it worth including for background. Ifin the script the import order is to load M2Crypto followed by PySVN,the function call attempting to connect to the subversion fails withthe following error: "pysvn._pysvn_2_5.ClientError: PROPFIND request failed on '' PROPFIND of '': SSL negotiation failed: SSL disabled due to library version mismatch (https://typhon)" IfI upgrade to Python 2.5.2 from 2.5.1, the python interpreter crasheswith a fatal exception instead of throwing the exception listed above. Now, if instead I import PySVN first before M2Crypto, then compilation of the script fails with this exception: "Traceback (most recent call last): File "D:\programs\working\test.py", line 20, in import M2Crypto File "C:\utils\Python25\Lib\site-packages\M2Crypto\__init__.py", line 14, in import __m2crypto ImportError: DLL load failed: The specified procedure could not be found." Furtherresearch into this problem shows that M2Crypto and PySVN are compiledagainst different versions of the OpenSSL dlls. I can't help butwonder if this suggests a wider problem with how dlls are handled. Itmakes sense that the Python VM would only want to load 1 copy of anydlls for memory and performance reasons, but then it leaves problemslike this one. Maybe the only 'workaround' is to compile externalmodules for yourself rather than relying on pre-built binaries. If youhave any information or advice for me, it would be appreciated. Thank you, John Siegrist -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdahlstrom at directedge.com Thu May 1 20:01:28 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Thu, 1 May 2008 14:01:28 -0400 Subject: [python-win32] Help about printing In-Reply-To: <481A0013.6060909@probo.com> References: <4816D36B.6060705@bertayjavi.com> <481705CE.9010300@bertayjavi.com><4819F3EE.8010802@probo.com><773A11EF827A4A60B23A26CDFD46BE8C@MCI1330> <481A0013.6060909@probo.com> Message-ID: <68D737040F1D204CA68A38C372141F44CF0F96@jc1wsmail3.global.knight.com> My quantum printer prints both at the same time, but every time I try to tell which is which, it changes the outcome. -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Roberts Sent: Thursday, May 01, 2008 1:38 PM To: Python-Win32 List Subject: Re: [python-win32] Help about printing Michel Claveau wrote: > Hi! > >> Many printers do not handle transparency. What kind of printer is it? > > An invisible printer? > ;-) Ironically, I often have the opposite problem. When my inkjet printer starts to run low, I find that it excels at printing transparent images, but neglects to print anything opaque. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com From mugunth at gmail.com Thu May 1 20:43:46 2008 From: mugunth at gmail.com (Muguntharaj Subramanian) Date: Fri, 2 May 2008 00:13:46 +0530 Subject: [python-win32] pyHook related doubt In-Reply-To: <8dd9fd0804290016p5a6c91ebx249eb05e87bdf451@mail.gmail.com> References: <8dd9fd0804290016p5a6c91ebx249eb05e87bdf451@mail.gmail.com> Message-ID: <8dd9fd0805011143m13b4dc85lc2972ee74d720f7b@mail.gmail.com> Hi All, I am resending this from tutor list since this seems to be appropriate place to ask this question. I am trying to create a custom keyboard driver program(like http://www.tavultesoft.com/keyman/ ) for windows using python. If this python script is run in the background, what is typed should be converted into my native language. For example if I hit 'a' in the keyboard, the output of the keyboard should be a tamil unicode character(which will be pre-defined by user). For making such program, I tried exploring pyHook based on this tutorial. http://mindtrove.info/articles/monitoring-global-input-with-pyhook/ >From the tutorial, I have learned to capture the keys typed, but couldn't understand how to change the keys before they reach the windows applications. Attached is the sample code I used (In this code basically I am trying to change all the keys typed to 'b' in this code, but its not working ) Please guide me on how i can change the keys sent to the application using pyHook. Or is there any other library that I can make use of to create such application. Regards, Mugunth -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pyhook-example.py Type: text/x-python Size: 1038 bytes Desc: not available URL: From tom.moulton at cox.net Thu May 1 23:31:23 2008 From: tom.moulton at cox.net (Tom Moulton) Date: Thu, 1 May 2008 17:31:23 -0400 Subject: [python-win32] wmi, Win32_ScheduledJob and Execution User Message-ID: <20080501173123.G5ZG3.21328.imail@eastrmwml08.mgt.cox.net> I've followed Tim Golden's cookbook example to schedule a job via his Python wmi module; however, I need to specify the user account a scheduled job gets executed under (i.e., the process owner). The cookbook example will schedule a job owned by SYSTEM. I note the actual WMI library provides for a User and Password option, which do not appear to be visible options from within the python wmi module's Win32_ScheduledJob call. I am uncertain if the aforementioned User and Password options actually cause the scheduled job to be run as that user? As a workaround I schedule my job via the Win32_ScheduledJob call and follow this up with a Win32_Process.Create call to "schtasks.exe", in which I change the job id's run user (i.e., via the /RU option) to the appropriate user name. Is there a way I can specify the run (or execution) user of a scheduled job within the Win32_ScheduledJob call or via the wmi interface? The way I am doing it right now, I could have simply called schtasks.exe directly and had it create the process with the intended run user, which I don't find very eloquent. Tom From rwupole at msn.com Fri May 2 02:53:24 2008 From: rwupole at msn.com (Roger Upole) Date: Thu, 1 May 2008 20:53:24 -0400 Subject: [python-win32] wmi, Win32_ScheduledJob and Execution User Message-ID: The Win32_ScheduledJob class represents "AT Service" jobs, and doesn't support running under a specific user. When you access the job via the Scheduled Tasks api, it's actually converted to the newer task format. You can use the ITaskScheduler interface to directly create and manipulate scheduled tasks. There are some demos in \win32comext\taskscheduler\test\ showing how it's used. Roger From mhammond at skippinet.com.au Fri May 2 03:00:14 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Fri, 2 May 2008 11:00:14 +1000 Subject: [python-win32] wmi, Win32_ScheduledJob and Execution User In-Reply-To: <20080501173123.G5ZG3.21328.imail@eastrmwml08.mgt.cox.net> References: <20080501173123.G5ZG3.21328.imail@eastrmwml08.mgt.cox.net> Message-ID: <057301c8abef$e3f07820$abd16860$@com.au> > I've followed Tim Golden's cookbook example to schedule a job via his > Python wmi module; however, I need to specify the user account a > scheduled job gets executed under (i.e., the process owner). The > cookbook example will schedule a job owned by SYSTEM. I note the > actual WMI library provides for a User and Password option, which do > not appear to be visible options from within the python wmi module's > Win32_ScheduledJob call. I am uncertain if the aforementioned User and > Password options actually cause the scheduled job to be run as that > user? As a workaround I schedule my job via the Win32_ScheduledJob > call and follow this up with a Win32_Process.Create call to > "schtasks.exe", in which I change the job id's run user (i.e., via the > /RU option) to the appropriate user name. > > Is there a way I can specify the run (or execution) user of a scheduled > job within the Win32_ScheduledJob call or via the wmi interface? The > way I am doing it right now, I could have simply called schtasks.exe > directly and had it create the process with the intended run user, > which I don't find very eloquent. I'm not sure exactly where you are at, but here is a snippet of code that we use at Enfold. Note that 'username' is a string param, and that we have special handling of '.\\localsystem' that you probably don't. from win32com.taskscheduler import taskscheduler ts=pythoncom.CoCreateInstance(taskscheduler.CLSID_CTaskScheduler,None, pythoncom.CLSCTX_INPROC_SERVER,taskscheduler.IID_ITaskScheduler) ... t=ts.NewWorkItem(task_name) t.SetComment("The comment") t.SetApplicationName(executable) ... # Note: Windows 2000 appears to allow the task to be set with an # incorrect password - it just fails to run. XP SP2+ fails to add the task. # None password is only valid for local system acct or if task flags contain TASK_FLAG_RUN_ONLY_IF_LOGGED_ON # so there is no point defaulting to a the current user - we don't know their password! # So we have hard-coded support for ".\LocalSystem" and set the task accordingly - # otherwise we need a username and password. if username.lower() == ".\\localsystem": t.SetAccountInformation("", None) else: assert username and password, "Need a username and password!" # almost everywhere else allows ".\username" but not here - expand manually. if username.startswith(".\\"): username = win32api.GetComputerName() + username[1:] t.SetAccountInformation(username, password) ... Hope that helps, Mark From mail at timgolden.me.uk Fri May 2 10:39:33 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 02 May 2008 09:39:33 +0100 Subject: [python-win32] wmi, Win32_ScheduledJob and Execution User In-Reply-To: <20080501173123.G5ZG3.21328.imail@eastrmwml08.mgt.cox.net> References: <20080501173123.G5ZG3.21328.imail@eastrmwml08.mgt.cox.net> Message-ID: <481AD345.7050504@timgolden.me.uk> [Tom Moulton] > I've followed Tim Golden's cookbook example to schedule a job via his Python wmi module; > however, I need to specify the user account a scheduled job gets executed under (i.e., the > process owner). The cookbook example will schedule a job owned by SYSTEM. I note the > actual WMI library provides for a User and Password option, which do not appear to be visible > options from within the python wmi module's Win32_ScheduledJob call. I am uncertain if the > aforementioned User and Password options actually cause the scheduled job to be run as that user? > As a workaround I schedule my job via the Win32_ScheduledJob call and follow this up with a > Win32_Process.Create call to "schtasks.exe", in which I change the job id's run user > (i.e., via the /RU option) to the appropriate user name. > Is there a way I can specify the run (or execution) user of a scheduled job within the > Win32_ScheduledJob call or via the wmi interface? The way I am doing it right now, I could > have simply called schtasks.exe directly and had it create the process with the intended > run user, which I don't find very eloquent. The answer seems to be: no you can't. You're limited by whatever interface the requisite WMI class exposes, and the .Create method has the signature: (JobId, ReturnValue)> which is a bit of a pain. As you say, once you use schtasks.exe, you might as well have used it in the first place. I would guess that this area in WMI has suffered from the repositioning of the old AT service as a kind of adjunct to the newer Scheduled Tasks mechanism. (AT basically ran as Local System or Local Network accounts with no alternative; scheduled tasks have to be set up to run as a specific user). As a workaround which I would think is more trouble than it was worth, you might have your scheduled job switch its user context internally using ImpersonateLoggedOnUser or another such mechanism. As *another* alternative, you could use the win32com.taskscheduler module from the pywin32 packages. It takes a bit of getting into, but I think there are some examples in the demo directories, and I've got some helper code squirrelled away if you're interested. TJG From javi at bertayjavi.com Fri May 2 17:01:34 2008 From: javi at bertayjavi.com (Javi) Date: Fri, 02 May 2008 17:01:34 +0200 Subject: [python-win32] Help about printing In-Reply-To: <4819F3EE.8010802@probo.com> References: <4816D36B.6060705@bertayjavi.com> <481705CE.9010300@bertayjavi.com> <4819F3EE.8010802@probo.com> Message-ID: <481B2CCE.5030704@bertayjavi.com> Tim Roberts escribi?: > Javi wrote: >> Hello, i use python 2.5, and wx, i'm trying to print a bitmap with >> transparency background but it doesnt print right, i just get a >> preview right but when i printed it, bitmap transparency background >> is printed on black. I dont know why , but i need to print it right. >> All help will be welcome. Thanks. >> >> P.D: i tried to print the wxpython demo 2.8 and it happens the same, >> transparency background is printed on black. > > Many printers do not handle transparency. What kind of printer is it? i tried with 3 printers, hp laserjet color 2550, ricoch 1600spn, and samsung laser i dont remenber the model, all black background. From adam at volition-inc.com Tue May 6 04:44:35 2008 From: adam at volition-inc.com (Adam Pletcher) Date: Mon, 5 May 2008 21:44:35 -0500 Subject: [python-win32] COM Dispatch w/multiple sessions? Message-ID: <893A44FF792E904A97B7515CE3419146F1ECF3@volimxs01.thqinc.com> I have a tool that interacts with a COM server created by a third-party application. My users sometimes need to open mutiple copies of that application. You can probably guess where this is going. Is there any way to tell win32com.client to connect to a specific instance/process of that application? I'm currently using the typical win32com.client.Dispatch, which seems to just bind to the first process opened using that COM interface. Any suggestions/workarounds appreciated. - Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Tue May 6 07:28:19 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Tue, 6 May 2008 15:28:19 +1000 Subject: [python-win32] COM Dispatch w/multiple sessions? In-Reply-To: <893A44FF792E904A97B7515CE3419146F1ECF3@volimxs01.thqinc.com> References: <893A44FF792E904A97B7515CE3419146F1ECF3@volimxs01.thqinc.com> Message-ID: <03c901c8af3a$02a76d30$07f64790$@com.au> You probably want win32com.client.DispatchEx(), which doesn't try and "get current object" magic. Cheers, Mark From: python-win32-bounces+mhammond=keypoint.com.au at python.org [mailto:python-win32-bounces+mhammond=keypoint.com.au at python.org] On Behalf Of Adam Pletcher Sent: Tuesday, 6 May 2008 12:45 PM To: python-win32 at python.org Subject: [python-win32] COM Dispatch w/multiple sessions? I have a tool that interacts with a COM server created by a third-party application. My users sometimes need to open mutiple copies of that application. You can probably guess where this is going. Is there any way to tell win32com.client to connect to a specific instance/process of that application? I'm currently using the typical win32com.client.Dispatch, which seems to just bind to the first process opened using that COM interface. Any suggestions/workarounds appreciated. - Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From rwupole at msn.com Tue May 6 10:23:42 2008 From: rwupole at msn.com (Roger Upole) Date: Tue, 6 May 2008 04:23:42 -0400 Subject: [python-win32] COM Dispatch w/multiple sessions? Message-ID: Adam Pletcher wrote: > I have a tool that interacts with a COM server created by a third-party > application. My users sometimes need to open mutiple copies of that > application. You can probably guess where this is going. > Is there any way to tell win32com.client to connect to a specific > instance/process of that application? > > I'm currently using the typical win32com.client.Dispatch, which seems to > just bind to the first process opened using that COM interface. Any > suggestions/workarounds appreciated. > > - Adam Some applications support this behaviour by using a Moniker to identify a particular instance. For example, Excel uses a file moniker (pythoncom.CreateFileMoniker), and the object's Bind method will connect to an instance of Excel that has that file loaded. If your app supports moniker semantics, you might be able to do it that way. Roger From siddhartha.veedaluru at gmail.com Tue May 6 12:08:29 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Tue, 6 May 2008 15:38:29 +0530 Subject: [python-win32] Create a System DSN which points to a MSSQL Database on remote machine Message-ID: <424b71ec0805060308v68d2cb4elba716fcfa68f19a4@mail.gmail.com> Hi, I'm trying to create a Sytem DSN which points to a MSSQL Database on remote machine. i tried using the following code snip in the following link http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/414879 i customized the script according to my requirements and it got created but i could not able to access the database. Here there the thing is while creating a system DSN manually, we can mention the type of authentication we want to connect to SQL Type of credential, Either through NT username and password OR Sql username password. But the code in the link does not support them. Can you guys help me in this regard. Thanks a million, Siddhartha -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Tue May 6 12:18:52 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 06 May 2008 11:18:52 +0100 Subject: [python-win32] Create a System DSN which points to a MSSQL Database on remote machine In-Reply-To: <424b71ec0805060308v68d2cb4elba716fcfa68f19a4@mail.gmail.com> References: <424b71ec0805060308v68d2cb4elba716fcfa68f19a4@mail.gmail.com> Message-ID: <4820308C.30909@timgolden.me.uk> siddhartha veedaluru wrote: > Hi, > > I'm trying to create a Sytem DSN which points to a MSSQL Database on remote > machine. > > i tried using the following code snip in the following link > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/414879 > > i customized the script according to my requirements and it got created but > i could not able to access the database. > > Here there the thing is while creating a system DSN manually, we can mention > the type of authentication we want to connect to > SQL > > Type of credential, > Either through NT username and password OR Sql username password. > > But the code in the link does not support them. That's what the "TrustedConnection = 'Yes'" thing at the end is doing. TJG From Kyle.Rickey at bakerhughes.com Tue May 6 16:25:50 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Tue, 6 May 2008 09:25:50 -0500 Subject: [python-win32] DDE AddTopic after server started Message-ID: I've got a simple DDE Server running that I would like to add/remove topics to on the fly. The reason for doing this is my application uses subprocess to open other programs which will then communicate back to mine using DDE. The topic will never be exactly the same though, because the subprocess expects the topic to be process_name+process_id For example, pid = subprocess.Popen(process_name).pid server = dde.CreateServer() server.AddTopic(DDE_Topic("wafieldsetup"+str(pid))) Now, I would like to create one DDE server when I start my application and as I launch these subprocesses, add/remove topics from the server. Is this possible? In the code below I've got my DDE server running in a separate thread. The whole thing will go inside of a wxpython application. import win32ui from pywin.mfc import object import dde import threading, pythoncom, time class DDETopic(object.Object): def __init__(self, topicName): object.Object.__init__(self, dde.CreateTopic(topicName)) def Exec(self, cmd): print "Other Topic asked to exec", cmd def test(): pythoncom.CoInitialize() server = dde.CreateServer() server.AddTopic(DDETopic("testprocess1234")) server.Create('MyServer') print "Pumping Messages" while 1: time.sleep(0.1) win32ui.PumpWaitingMessages(0, -1) threading.Thread(target=test).start() #Launch a subprocess #Add new topic to server Is this going to work or do I need to create a new DDE Server for each subprocess (seems clunky)? -Kyle Rickey From le.dahut at laposte.net Tue May 6 17:10:57 2008 From: le.dahut at laposte.net (le dahut) Date: Tue, 06 May 2008 17:10:57 +0200 Subject: [python-win32] Vista and listening sockets Message-ID: <48207501.5@laposte.net> Hello, When launching an app that opens a socket, windows Vista complains that I have to accept it before it is launched and then that the firewall accepts the opening of the port. Is there a way to register my app to be launched by users without UAC warning ? Is there a way to open the port on the firewall inside the program or its installer ? Thanks. From rdahlstrom at directedge.com Tue May 6 17:24:01 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Tue, 6 May 2008 11:24:01 -0400 Subject: [python-win32] Vista and listening sockets In-Reply-To: <48207501.5@laposte.net> References: <48207501.5@laposte.net> Message-ID: <68D737040F1D204CA68A38C372141F44CF0FEB@jc1wsmail3.global.knight.com> One would hope that there is no way to accomplish what you are looking to do. The user could, however, turn off their security, or register your app to run as administrator. -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of le dahut Sent: Tuesday, May 06, 2008 11:11 AM To: Python-Win32 List Subject: [python-win32] Vista and listening sockets Hello, When launching an app that opens a socket, windows Vista complains that I have to accept it before it is launched and then that the firewall accepts the opening of the port. Is there a way to register my app to be launched by users without UAC warning ? Is there a way to open the port on the firewall inside the program or its installer ? Thanks. _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com From timr at probo.com Tue May 6 19:22:03 2008 From: timr at probo.com (Tim Roberts) Date: Tue, 06 May 2008 10:22:03 -0700 Subject: [python-win32] Vista and listening sockets In-Reply-To: <48207501.5@laposte.net> References: <48207501.5@laposte.net> Message-ID: <482093BB.8000903@probo.com> le dahut wrote: > Hello, > > When launching an app that opens a socket, windows Vista complains > that I have to accept it before it is launched and then that the > firewall accepts the opening of the port. > > Is there a way to register my app to be launched by users without UAC > warning ? > > Is there a way to open the port on the firewall inside the program or > its installer ? You can tweak the firewall settings, but you have to be UAC to do so, because you have to write to the HKEY_LOCAL_MACHINE registry hive. If you have a setup application that has "setup" in the file name, this should work. BTW, this may be the longest registry path you will ever encounter: HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ SharedAccess\ Parameters\ FirewallPolicy\ DomainProfile\ AuthorizedApplications\ List\ Within that key, create a REG_SZ value whose name is the path to your application, whose value is a 4-part string separated by colons: :*:Enabled: Put the same thing into ... StandardProfile\ AuthorizedApplications\ List\ -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mhammond at skippinet.com.au Wed May 7 04:48:02 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Wed, 7 May 2008 12:48:02 +1000 Subject: [python-win32] Vista and listening sockets In-Reply-To: <482093BB.8000903@probo.com> References: <48207501.5@laposte.net> <482093BB.8000903@probo.com> Message-ID: <000f01c8afec$c53310e0$4f9932a0$@com.au> Tim wrote: > You can tweak the firewall settings, but you have to be UAC to do so, > because you have to write to the HKEY_LOCAL_MACHINE registry hive. Note you can also do it via COM - see http://mail.python.org/pipermail/python-win32/2006-May/004694.html (although I'm quite certain you will still need to be elevated to do so) Mark From mc at mclaveau.com Wed May 7 08:27:22 2008 From: mc at mclaveau.com (Michel Claveau) Date: Wed, 7 May 2008 08:27:22 +0200 Subject: [python-win32] Vista and listening sockets In-Reply-To: <48207501.5@laposte.net> References: <48207501.5@laposte.net> Message-ID: Bonjour ! > Is there a way to register my app to be launched by users without UAC > warning ? J'ai r?alis? un utilitaire, actuellement en b?ta, qui fait les choses suivantes : - lancer l'utilitaire, UNE SEULE FOIS, en d?but de session (n?cessite une validation de l'UAC) - l'utilitaire s'appelle RUNWUAC - il s'installe en tant que r?sidant invisible - on l'appelle par {CTRL} ? - l'appel ouvre un menu qui permet, soit de lancer des applications, soit de lancer une commande. Tous ces lancements sont alors effectu? avec ?l?vation de privil?ges. - t?l?chargement : http://mclaveau.com/gvrac (choisir RUNWUAC) - (un peu) plus de renseignement dans l'aide int?gr?e. > Is there a way to open the port on the firewall inside the program or its > installer ? Il est possible de configurer le parefeu de Vista (ou d'XP), en invite de commande, avec NETSH AMHA, tout ?a n'est pas li? ? Python. @-salutations -- Michel Claveau From le.dahut at laposte.net Wed May 7 17:02:48 2008 From: le.dahut at laposte.net (le dahut) Date: Wed, 07 May 2008 17:02:48 +0200 Subject: [python-win32] ShellExecuteEx Message-ID: <4821C498.9070809@laposte.net> Hello, Still with Vista, when using CreateProcess(...'regedit'...) to save/restore some registry keys I get and error 740 "The requested operation requires elevation". According to msdn ShellExecuteEx should be used instead of CreateProcess. Where Can I find ShellExecuteEx ? Are there other methods to save/load standard .reg files that "regedit /E or /S" ? From mhammond at skippinet.com.au Thu May 8 03:15:27 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Thu, 8 May 2008 11:15:27 +1000 Subject: [python-win32] ShellExecuteEx In-Reply-To: <4821C498.9070809@laposte.net> References: <4821C498.9070809@laposte.net> Message-ID: <010101c8b0a9$02896720$079c3560$@com.au> You can generally get away with just using "ShellExecute" - the trick is to use "runas" as the verb. But ShellExecuteEx is in win32com.shell.shell if you really need its extra capabilities. Mark > -----Original Message----- > From: python-win32-bounces at python.org [mailto:python-win32- > bounces at python.org] On Behalf Of le dahut > Sent: Thursday, 8 May 2008 1:03 AM > To: Python-Win32 List > Subject: [python-win32] ShellExecuteEx > > Hello, > > Still with Vista, when using CreateProcess(...'regedit'...) to > save/restore some registry keys I get and error 740 "The requested > operation requires elevation". > According to msdn ShellExecuteEx should be used instead of > CreateProcess. > > Where Can I find ShellExecuteEx ? > Are there other methods to save/load standard .reg files that "regedit > /E or /S" ? > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From neharai.nitk at gmail.com Thu May 8 08:50:12 2008 From: neharai.nitk at gmail.com (neha rai) Date: Thu, 8 May 2008 12:20:12 +0530 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: References: Message-ID: I am making a tool that needs to open subwindow of another application, enter some text in it click ok and then open the same window again. i am able to put text and click 'OK' but I am not able to open the same window again using the python code. I need some thing that can remember what i opened(or the last window opened) and open it again. Can anybody help me. Neha -------------- next part -------------- An HTML attachment was scrubbed... URL: From Devendran.Chandra at smartm.com Thu May 8 12:22:01 2008 From: Devendran.Chandra at smartm.com (Chandra,Devendran) Date: Thu, 8 May 2008 18:22:01 +0800 Subject: [python-win32] Simulating a static click on a property under SysListView32 Message-ID: hie everyone, Forgive me if this is repetitive, i did search the archives, but could not get literature that fits my beginner understanding. I would like to simulate a static click on a value which falls under the sysListView32 category, but unfortunately i could not locate the commands under winGuiAuto. I did come across some postings were the has been some success in doing this. Can anyone help me on this request and share some insights into doing this? Thank you very much! Rgds, Devendran Test Engineering -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Thu May 8 16:28:34 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 08 May 2008 15:28:34 +0100 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: References: Message-ID: <48230E12.1030406@timgolden.me.uk> neha rai wrote: > I am making a tool that needs to open subwindow of another application, > enter some text in it click ok and then open the same window again. i am > able to put text and click 'OK' but I am not able to open the same window > again using the python code. I need some thing that can remember what i > opened(or the last window opened) and open it again. I'm sorry, but for the life of me I can't work out what you're trying to do here. Unless someone has better intuition than me and comes to the rescue, could you post some code to show what's you're doing and indicate where it doesn't work? Thanks TJG PS If you aren't already, worth looking at WATSUP [1] and PyWinAuto [2] [1] http://www.tizmoi.net/watsup/intro.html [2] http://pywinauto.pbwiki.com/ From mail at timgolden.me.uk Fri May 9 15:32:06 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 09 May 2008 14:32:06 +0100 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: References: <48230E12.1030406@timgolden.me.uk> Message-ID: <48245256.9030204@timgolden.me.uk> [Copying back to python-win32 list] Neha: please keep your posts on-list. This will help you since I'm sure there are other people than me out there who can help; it will help me, because I don't have time or the competence to deal with every single query that comes up; and it helps anyone else who might be following the thread now or in the future to see what happens. neha rai wrote: > Hi Tim, > Thanks for showing interest. due to some reasons i can't post > my code but I'll tell you in detail what i am doing. OK. That's going to make it more difficult. It's remarkably hard to describe accurately a programming issue with showing the code, but we'll have a go. > Tool details: > > * My tool identifies the active window on the screen. > * identifies all its text boxes. > * populates a gui on which user can see the present text areas. > * Asks user to push type of data(digits,alphabets, length of data ets) for > each text box. > > * creates file for set of input. i.e suppose if in window there are 3 text > boxes it will create 3 file. and each file will contain 100s of set of input > varying in length. > * pushes user defined data in found text boxes by reading from file. > * and then my tool clicks on the action button(to get the input > accepted) i.e. in most of the cases is OK. I hope you've got a good reason for doing things this way: it looks awfully convoluted! > Now what is happening, the window gets closed after clicking OK (as it > should be). what i want to open the same window and push another set of data > in it. > So for this purpose i want some thing which can remeber what window the > user opened so that it can be opened again. In same window there can be many > tabs. so something is needed which can open exactly the same page on which > the user was working. I'm still not 100%, but presumably whatever piece of code you're running in the first place (which for various reasons you can't show us) to open the window can persist whatever pieces of data it needs to open the same window again. Maybe it's the window class or its hwnd or its name. I don't understand why, if the program can do this once -- and you seem to suggest that it can -- that it can't do it again. I may be being obtuse but I can't really see where the problem lies. Maybe someone else on the list has a better idea? TJG From mdriscoll at co.marshall.ia.us Fri May 9 15:37:05 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Fri, 09 May 2008 08:37:05 -0500 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: <48230E12.1030406@timgolden.me.uk> References: <48230E12.1030406@timgolden.me.uk> Message-ID: <48245381.8010307@co.marshall.ia.us> Tim Golden wrote: >
neha rai > wrote: >> I am making a tool that needs to open subwindow of another application, >> enter some text in it click ok and then open the same window again. i am >> able to put text and click 'OK' but I am not able to open the same >> window >> again using the python code. I need some thing that can remember what i >> opened(or the last window opened) and open it again. > > I'm sorry, but for the life of me I can't work out what you're trying > to do here. Unless someone has better intuition than me and comes > to the rescue, could you post some code to show what's you're doing > and indicate where it doesn't work? > > Thanks > > TJG > > PS If you aren't already, worth looking at WATSUP [1] and PyWinAuto [2] > > [1] http://www.tizmoi.net/watsup/intro.html > [2] http://pywinauto.pbwiki.com/ > >
Tim, The OP is probably talking about a window that's part of the application, like when you open the Preferences dialog or how some Excel versions can allow one to open multiple spreadsheets and minimize them within the application. As to how to manipulate that sort of thing in a pre-made app... I haven't the slightest... except maybe SendKeys or the links you gave. Mike From sriram.sundararajan at gmail.com Fri May 9 18:37:58 2008 From: sriram.sundararajan at gmail.com (Sriram Sundararajan) Date: Fri, 9 May 2008 10:37:58 -0600 Subject: [python-win32] Excel - accessing a control's properties in an event handler Message-ID: I have a question on the excelAddin.py sample in the win32com\demos folder. We create a Tool Bar, add a button to it, btnMyButton = cbcMyBar.Controls.Add(Type=constants.msoControlButton, Parameter="Greetings") 'register' the button with the ButtonEvent class, btnMyButton=self.toolbarButton = DispatchWithEvents(btnMyButton, ButtonEvent) and set a couple of properties. btnMyButton.Caption = "&Python" btnMyButton.TooltipText = "Python rules the World" In the OnClick event handler of the ButtonEvent class, class ButtonEvent: def OnClick(self, button, cancel): 1. How is the 'button' argument related to the actual button that was clicked? It showed up as a PyIDispatch object when I tried printing it. 2. Assuming there is more than one button that can be clicked, how would I access some of the properties of the button instance that was actually clicked by the user? Thanks Sriram From neharai.nitk at gmail.com Mon May 12 07:29:27 2008 From: neharai.nitk at gmail.com (neha rai) Date: Mon, 12 May 2008 10:59:27 +0530 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: <48245381.8010307@co.marshall.ia.us> References: <48230E12.1030406@timgolden.me.uk> <48245381.8010307@co.marshall.ia.us> Message-ID: Hi Tim and Mike, As Tim said "whatever piece of code you're running in the first place to open the window can persist whatever pieces of data it needs to open the same window again." First time the window is opened by the user, user can pick any window on which it needs to work (in my case window are is subwindow of a application) My code identifies the window by using : hand=win32gui.GetForegroundWindow() My code performs action on the window and closes it.. now i want it to open automatically. I hope its more clear now.. Please let me know if any of you have a way to do this. Thanks Neha On Fri, May 9, 2008 at 7:07 PM, Mike Driscoll wrote: > Tim Golden wrote: > >>
neha rai >> wrote: >> >>> I am making a tool that needs to open subwindow of another application, >>> enter some text in it click ok and then open the same window again. i am >>> able to put text and click 'OK' but I am not able to open the same >>> window >>> again using the python code. I need some thing that can remember what i >>> opened(or the last window opened) and open it again. >>> >> >> I'm sorry, but for the life of me I can't work out what you're trying >> to do here. Unless someone has better intuition than me and comes >> to the rescue, could you post some code to show what's you're doing >> and indicate where it doesn't work? >> >> Thanks >> >> TJG >> >> PS If you aren't already, worth looking at WATSUP [1] and PyWinAuto [2] >> >> [1] http://www.tizmoi.net/watsup/intro.html >> [2] http://pywinauto.pbwiki.com/ >> >>
>> > Tim, > > The OP is probably talking about a window that's part of the application, > like when you open the Preferences dialog or how some Excel versions can > allow one to open multiple spreadsheets and minimize them within the > application. > > As to how to manipulate that sort of thing in a pre-made app... I haven't > the slightest... except maybe SendKeys or the links you gave. > > Mike > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Mon May 12 10:16:09 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Mon, 12 May 2008 09:16:09 +0100 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: References: <48230E12.1030406@timgolden.me.uk> <48245381.8010307@co.marshall.ia.us> Message-ID: <4827FCC9.1020904@timgolden.me.uk> neha rai wrote: > First time the window is opened by the user, user can pick any window on > which it needs to work (in my case window are is subwindow of a application) You're not making life easy here by your varied use of the term "window". > My code identifies the window by using : > hand=win32gui.GetForegroundWindow() > My code performs action on the window and closes it.. now i want it to open > automatically. OK. I think I see what you're talking about. You're saying that you are, in some way, monitoring an application. Within the app the user performs (pressing a button, selecting a menu, etc) which activates some window, perhaps a dialog box? They do whatever they do and finally take some other action which closes the window. You know what the window handle was but you don't know how to reopen it? Am I right? I think you're stuck. In the absence of any code from your end, it's nearly impossible to determine what the sequence of events is, and it's not going to be easy to guess what action to take to initiate an arbitrary window. I'm assuming the application isn't one you control. You could, perhaps, do *very* messy and low-level things like installing a message hook [1] and attempting to infer what command or message initiated the window. But I suspect from the level of your questions that you're in deep enough as it is and I think you'd be out of your depth there. TJG [1] http://msdn.microsoft.com/en-us/library/ms632589(VS.85).aspx From siddhartha.veedaluru at gmail.com Mon May 12 12:30:31 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Mon, 12 May 2008 16:00:31 +0530 Subject: [python-win32] Create a System DSN which points to a MSSQL Database on Remote Machine Message-ID: <424b71ec0805120330t435fb683o8fc4c8b81de19358@mail.gmail.com> Thanks tim, But when i give user and pass information it is not able to create the dsn It is default local system user name and creating, which fails connecting to database. i gave the user information as following: "SQL Server", SERVER="SQLSVR01",DESCRIPTION="MS SQL Server DSN", DSN="MyDSN", DATABASE="Testing",uid="sa",pwd="sysadmin"): if uid and pwd is not given then it creates the DSN with logged in user as username. Thanks a million, Siddharrtha -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Mon May 12 12:40:27 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Mon, 12 May 2008 11:40:27 +0100 Subject: [python-win32] Create a System DSN which points to a MSSQL Database on Remote Machine In-Reply-To: <424b71ec0805120330t435fb683o8fc4c8b81de19358@mail.gmail.com> References: <424b71ec0805120330t435fb683o8fc4c8b81de19358@mail.gmail.com> Message-ID: <48281E9B.8030803@timgolden.me.uk> siddhartha veedaluru wrote: > But when i give user and pass information it is not able to create the dsn > It is default local system user name and creating, which fails connecting to > database. > > i gave the user information as following: > "SQL Server", SERVER="SQLSVR01",DESCRIPTION="MS SQL Server DSN", > DSN="MyDSN", DATABASE="Testing",uid="sa",pwd="sysadmin"): > if uid and pwd is not given then it creates the DSN with logged in user as > username. Siddharrtha, the most useful thing you can do at this point is to post some code, ideally with a traceback if one occurs. I'm finding it a little difficult to understand what you're doing. To take this forward, perhaps, the following code fragments use the pyodbc [1] module to connect to an MSSQL server with passthrough authentication and with a specific username / password. I'm not clear whether you're trying to do the same thing or something else, but at least it'll provide a starting point for discussion :) import pyodbc def connection (server, database, username="", password="", **kwargs): connectors = ["Driver={SQL Server}"] connectors.append ("Server=%s" % server) connectors.append ("Database=%s" % database) if username: connectors.append ("UID=%s" % username) connectors.append ("PWD=%s" % password) else: connectors.append ("TrustedConnection=Yes") return pyodbc.connect (";".join (connectors), **kwargs) db1 = connection ("SVR", "DB") # use passthrough authentication db2 = connection ("SVR", "DB", "sa", "password") # use specific credentials [1] http://pyodbc.sourceforge.net/ From rwupole at msn.com Mon May 12 14:03:01 2008 From: rwupole at msn.com (Roger Upole) Date: Mon, 12 May 2008 08:03:01 -0400 Subject: [python-win32] Excel - accessing a control's properties in an event Message-ID: Sriram Sundararajan wrote: >I have a question on the excelAddin.py sample in the win32com\demos folder. > > We create a Tool Bar, add a button to it, > btnMyButton = cbcMyBar.Controls.Add(Type=constants.msoControlButton, > Parameter="Greetings") > > 'register' the button with the ButtonEvent class, > btnMyButton=self.toolbarButton = DispatchWithEvents(btnMyButton, > ButtonEvent) > > and set a couple of properties. > btnMyButton.Caption = "&Python" > btnMyButton.TooltipText = "Python rules the World" > > In the OnClick event handler of the ButtonEvent class, > class ButtonEvent: > def OnClick(self, button, cancel): > > 1. How is the 'button' argument related to the actual button that was > clicked? It showed up as a PyIDispatch object when I tried printing > it. > 2. Assuming there is more than one button that can be clicked, how > would I access some of the properties of the button instance that was > actually clicked by the user? > > Thanks > Sriram You can use win32com.client.Dispatch(button) to get a wrapped object that exposes all the properties of the button. This will allow you to access the Caption, TooltipText, or any other property you need to identify the button. Roger From antonyjoseph89 at gmail.com Tue May 13 08:37:22 2008 From: antonyjoseph89 at gmail.com (Antony Joseph) Date: Tue, 13 May 2008 12:07:22 +0530 Subject: [python-win32] Hide the console as soon as the script starts. Message-ID: Hi , I am trying to hide the console as soon as the script starts and display console window to System Tray . Could someone point me to any links. Thanks Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From graemeglass at gmail.com Tue May 13 08:55:53 2008 From: graemeglass at gmail.com (Graeme Glass) Date: Tue, 13 May 2008 08:55:53 +0200 Subject: [python-win32] Hide the console as soon as the script starts. In-Reply-To: References: Message-ID: On Tue, May 13, 2008 at 8:37 AM, Antony Joseph wrote: > Hi , > I am trying to hide the console as soon as the script starts > and display console window to System Tray . > Could someone point me to any links. > > Thanks > Antony Execute your script with pythonw.exe For more info: http://www.oreilly.com/catalog/pythonwin32/chapter/ch20.html HTH, Graeme -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Tue May 13 09:46:39 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 13 May 2008 08:46:39 +0100 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: References: <48230E12.1030406@timgolden.me.uk> <48245381.8010307@co.marshall.ia.us> <4827FCC9.1020904@timgolden.me.uk> Message-ID: <4829475F.6060109@timgolden.me.uk> [copying back to list and rearranging slightly] >> neha rai wrote: >>> First time the window is opened by the user, user can pick any window on >>> which it needs to work (in my case window are is subwindow of a >>> application) [Tim Golden] >> I think you're stuck. In the absence of any code from your end, it's >> nearly impossible to determine what the sequence of events is, and >> it's not going to be easy to guess what action to take to initiate an >> arbitrary window. [... snip link to system hooks documentation ...] neha rai wrote: > yeah.. you got my problem. But its really sad to know that there is now way > out... i too visited the link you sent.. but you were right it becomes very > messy for me. Can I suggest, if you haven't already done so, that you take the query to one of the Windows programming newsgroups / forums etc.? It's really a Windows question rather than a Python one as such. Try describing the requirement on one of those groups and if they come up with a solution in Microsoft terms, bring it back here and we'll see how readily it can translate into Python. TJG From mail at timgolden.me.uk Tue May 13 10:51:57 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 13 May 2008 09:51:57 +0100 Subject: [python-win32] Hide the console as soon as the script starts. In-Reply-To: References: Message-ID: <482956AD.3070005@timgolden.me.uk> Antony Joseph wrote: > I am trying to hide the console as soon as the script starts and > display console window to System Tray . > Could someone point me to any links. An example of running a taskbar app comes with the pywin32 demos. On my machine it's located at: C:\Python25\Lib\site-packages\win32\Demos\win32gui_taskbar.py TJG From mail at timgolden.me.uk Tue May 13 09:46:39 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 13 May 2008 08:46:39 +0100 Subject: [python-win32] how to activate subwindow of the application ??? In-Reply-To: References: <48230E12.1030406@timgolden.me.uk> <48245381.8010307@co.marshall.ia.us> <4827FCC9.1020904@timgolden.me.uk> Message-ID: <4829475F.6060109@timgolden.me.uk> <<< No Message Collected >>> From python at bdurham.com Tue May 13 13:47:15 2008 From: python at bdurham.com (python at bdurham.com) Date: Tue, 13 May 2008 07:47:15 -0400 Subject: [python-win32] Hide the console as soon as the script starts. In-Reply-To: <482956AD.3070005@timgolden.me.uk> References: <482956AD.3070005@timgolden.me.uk> Message-ID: <1210679235.19886.1252882157@webmail.messagingengine.com> Antony, If you're just trying to hide the console Window, rename your python script with a *.pyw file extension or launch it via pythonw.exe vs. python.exe. I have no idea how to have a Python application display an icon in the System Tray (vs. Taskbar). That's a very interesting question. Malcolm From ionel.mc at gmail.com Tue May 13 18:09:15 2008 From: ionel.mc at gmail.com (Ionel Maries Cristian) Date: Tue, 13 May 2008 19:09:15 +0300 Subject: [python-win32] Need reviews for a patch in win32file for TransmitFile and ConnectEx Message-ID: the patches are tracked here: https://sourceforge.net/tracker/index.php?func=detail&aid=1962146&group_id=78018&atid=551956 and here: https://sourceforge.net/tracker/index.php?func=detail&aid=1937527&group_id=78018&atid=551956 mark hammond requested that i post them here (he's a bit busy) as notes on the ConnectEx call: - one needs to get the pointer to the ConnectEx from the socket via a WSAIoctl call and i'm going the safe way and getting the pointer every time (sadly the msdn docs don't say if we always get the same pointer - suppose we use ConnectEx with ip v4 and v6 sockets and the pointer could be different) - i'm using a getaddrinfo to convert the (host,port) tuple to a addrinfo struct I've included some testcases for the 2 patches on the bugtracker (test_connectex.py, test_transmitfile.py) -- http://ionelmc.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sriram.sundararajan at gmail.com Tue May 13 19:49:47 2008 From: sriram.sundararajan at gmail.com (Sriram Sundararajan) Date: Tue, 13 May 2008 11:49:47 -0600 Subject: [python-win32] Excel - accessing a control's properties in an event Message-ID: > Sriram Sundararajan wrote: > >I have a question on the excelAddin.py sample in the win32com\demos folder. > > > > We create a Tool Bar, add a button to it, > > btnMyButton = cbcMyBar.Controls.Add(Type=constants.msoControlButton, > > Parameter="Greetings") > > > > 'register' the button with the ButtonEvent class, > > btnMyButton=self.toolbarButton = DispatchWithEvents(btnMyButton, > > ButtonEvent) > > > > and set a couple of properties. > > btnMyButton.Caption = "&Python" > > btnMyButton.TooltipText = "Python rules the World" > > > > In the OnClick event handler of the ButtonEvent class, > > class ButtonEvent: > > def OnClick(self, button, cancel): > > > > 1. How is the 'button' argument related to the actual button that was > > clicked? It showed up as a PyIDispatch object when I tried printing > > it. > > 2. Assuming there is more than one button that can be clicked, how > > would I access some of the properties of the button instance that was > > actually clicked by the user? > > > > Thanks > > Sriram > > You can use win32com.client.Dispatch(button) to get a wrapped > object that exposes all the properties of the button. > This will allow you to access the Caption, TooltipText, or any > other property you need to identify the button. > > Roger Roger, Thanks for the answer. I could've sworn I tried that.. but it works like a charm now! Sriram From rwupole at msn.com Tue May 13 19:53:56 2008 From: rwupole at msn.com (Roger Upole) Date: Tue, 13 May 2008 13:53:56 -0400 Subject: [python-win32] Need reviews for a patch in win32file for TransmitFile and ConnectEx Message-ID: Ionel Maries Cristian wrote: > the patches are tracked here: > https://sourceforge.net/tracker/index.php?func=detail&aid=1962146&group_id=78018&atid=551956 > and here: > https://sourceforge.net/tracker/index.php?func=detail&aid=1937527&group_id=78018&atid=551956 > > mark hammond requested that i post them here (he's a bit busy) > > as notes on the ConnectEx call: > - one needs to get the pointer to the ConnectEx from the socket via a > WSAIoctl call and i'm going the safe way and getting the pointer every > time > (sadly the msdn docs don't say if we always get the same pointer - suppose > we use ConnectEx with ip v4 and v6 sockets and the pointer could be > different) > - i'm using a getaddrinfo to convert the (host,port) tuple to a addrinfo > struct > > I've included some testcases for the 2 patches on the bugtracker > (test_connectex.py, test_transmitfile.py) > A couple of things in the ConnectEx function: The XDECREF of obBuf is unnecessary, and can cause a crash. The buffer size is a DWORD, but you're passing a Py_ssize_t.which is larger when compiled for 64-bit. You can use PyWinObject_AsReadBuffer to convert a buffer with a DWORD length. It will also handle None for you, which allows you to simply initialize obBuf to Py_None instead of NULL. Also, the entire output section can be simplified to: rv=Py_BuildValue("ii", rc, sent) Roger From otaeris at o2.pl Wed May 14 13:21:49 2008 From: otaeris at o2.pl (otaeris at o2.pl) Date: Wed, 14 May 2008 13:21:49 +0200 Subject: [python-win32] =?utf-8?q?Attaching_Menu_to_Any_App?= In-Reply-To: <011101c8b5a8$f9b019a0$ed104ce0$@com.au> References: <3bb293d7.628b5f16.482ab0be.b7341@o2.pl> <011101c8b5a8$f9b019a0$ed104ce0$@com.au> Message-ID: <6f090516.3760cce2.482acb4d.ede11@o2.pl> Hi, I'm having problem with attaching a subMenu to an application MenuBar. SubMenu is there, hanging from the MenuBar but it doesn't send/respond to any events. How can I get events either by pywin32 or wxpython ? There is great example sitting here :C:\Python25\Lib\site-packages\win32\Demos\win32gui_taskbar.py This example is great but how to, instead of using Shell_NotifyIcon(NIM_ADD, nid) connect submenu it to application menubar ? Regards, CgBartek From otaeris at o2.pl Wed May 14 13:23:09 2008 From: otaeris at o2.pl (otaeris at o2.pl) Date: Wed, 14 May 2008 13:23:09 +0200 Subject: [python-win32] =?utf-8?q?Attaching_AubMenu_to_Any_Apps_MenuBar?= Message-ID: <7484095e.3f15e2f0.482acb9d.b345@o2.pl> Hi, I'm having problem with attaching a subMenu to an application MenuBar. SubMenu is there, hanging from the MenuBar but it doesn't send/respond to any events. How can I get events either by pywin32 or wxpython ? There is great example sitting here :C:\Python25\Lib\site-packages\win32\Demos\win32gui_taskbar.py This example is great but how to, instead of using Shell_NotifyIcon(NIM_ADD, nid) connect submenu it to application menubar ? Regards, CgBartek From timr at probo.com Wed May 14 18:59:51 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 14 May 2008 09:59:51 -0700 Subject: [python-win32] Attaching Menu to Any App In-Reply-To: <6f090516.3760cce2.482acb4d.ede11@o2.pl> References: <3bb293d7.628b5f16.482ab0be.b7341@o2.pl> <011101c8b5a8$f9b019a0$ed104ce0$@com.au> <6f090516.3760cce2.482acb4d.ede11@o2.pl> Message-ID: <482B1A87.4040209@probo.com> otaeris at o2.pl wrote: > I'm having problem with attaching a subMenu to an application MenuBar. SubMenu is there, hanging from the MenuBar but it doesn't send/respond to any events. > How can I get events either by pywin32 or wxpython ? > > There is great example sitting here :C:\Python25\Lib\site-packages\win32\Demos\win32gui_taskbar.py > > This example is great but how to, instead of using Shell_NotifyIcon(NIM_ADD, nid) connect submenu it to application menubar ? > Are you talking about attaching to a menu in another application? That requires hooking. You actually have to inject a DLL of your own into the code space of the owning process, then override that window's windowproc so that you can intercept its window messages. I would arrogantly assert that this is not possible in Python, although I'm sure one of the gurus will be happy to contradict me. If it were me, I would write a small DLL in C to do the hooking and subclass the window, then come up with some kind of communication scheme back to my Python application. If I have misunderstood your request, then please excuse me. What are you planning to do in this menu handler? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From siddhartha.veedaluru at gmail.com Thu May 15 09:47:41 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Thu, 15 May 2008 13:17:41 +0530 Subject: [python-win32] Will wmi can a command on remore host and get the return code Message-ID: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> Hi, i'm tring to execute a exe that is placed in the mapped network drive on remote machine it seems it is not getting recognised. How can i run the exe on the mapped network drive Thanks, Siddhartha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgailer at gmail.com Thu May 15 13:02:59 2008 From: bgailer at gmail.com (bob gailer) Date: Thu, 15 May 2008 07:02:59 -0400 Subject: [python-win32] Will wmi can a command on remore host and get the return code In-Reply-To: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> References: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> Message-ID: <482C1863.30804@gmail.com> siddhartha veedaluru wrote: > Hi, > > i'm tring to execute a exe that is placed in the mapped network drive > on remote machine > it seems it is not getting recognised. > > How can i run the exe on the mapped network drive > Aw come on .... I'd think by now you'd know how to ask a question. -- Bob Gailer 919-636-4239 Chapel Hill, NC From mail at timgolden.me.uk Thu May 15 13:04:26 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 15 May 2008 12:04:26 +0100 Subject: [python-win32] Will wmi can a command on remore host and get the return code In-Reply-To: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> References: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> Message-ID: <482C18BA.2050406@timgolden.me.uk> siddhartha veedaluru wrote: > Hi, > > i'm tring to execute a exe that is placed in the mapped network drive on > remote machine > it seems it is not getting recognised. > > How can i run the exe on the mapped network drive Please post some code -- and any traceback -- so we can see what you're doing. Thanks TJG From otaeris at o2.pl Thu May 15 13:21:04 2008 From: otaeris at o2.pl (otaeris at o2.pl) Date: Thu, 15 May 2008 13:21:04 +0200 Subject: [python-win32] =?utf-8?q?Attaching_Menu_to_Any_App?= In-Reply-To: <482B1A87.4040209@probo.com> References: <3bb293d7.628b5f16.482ab0be.b7341@o2.pl> <011101c8b5a8$f9b019a0$ed104ce0$@com.au> <6f090516.3760cce2.482acb4d.ede11@o2.pl> <482B1A87.4040209@probo.com> Message-ID: <6f3c956b.13c8376a.482c1ca0.44261@o2.pl> Hello Tim, Thanks for your answer. Yes, this is exactly what I want to acomplish. Application i'm working on is going to be called from that menu. Plan is to attach it automatically to some apps through running service or some process. I red a lot about hooking WinApi but I don't realy know C that much. Writing a simple DLL sounds really easy. How do you mean subclassing a window and overtwritting windowproc can be done in python ? Regards, CgBartek > Are you talking about attaching to a menu in another application? That > requires hooking. You actually have to inject a DLL of your own into > the code space of the owning process, then override that window's > windowproc so that you can intercept its window messages. > > I would arrogantly assert that this is not possible in Python, although > I'm sure one of the gurus will be happy to contradict me. If it were > me, I would write a small DLL in C to do the hooking and subclass the > window, then come up with some kind of communication scheme back to my > Python application. > > If I have misunderstood your request, then please excuse me. What are > you planning to do in this menu handler? > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From siddhartha.veedaluru at gmail.com Thu May 15 13:23:17 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Thu, 15 May 2008 16:53:17 +0530 Subject: [python-win32] python-win32 Digest, Vol 62, Issue 13 In-Reply-To: References: Message-ID: <424b71ec0805150423u15d50f5clde9f7a51b3f06663@mail.gmail.com> Hi, Sorry about the confusing question. Here is what i want to achieve i have certain updates that i need to install on different machines These updates are placed in a location and is mapped to all the machines There will be an exe file say "InstallUpdate.exe" for every update. i need to run this exe on all the machines. i tried running the exe using the following code import wmi, os.path, time connection = wmi.connect_server (server="orcl", user="Administrator", password="boss") c = wmi.WMI (wmi=connection) pid, result = c.Win32_Process.Create(r'cmd /c Z:\update01\InstallUpdate.exe > C:\sid.txt') if result != 0: print "Update installation failed" else: print "Update installation Suceeded" Now i couldn't able to run InstallUpdate.exe as this is on Mapped drive. If i copy the same update to local drive on the remote machine and run it, its installing. 1) what should be added here inorder to run it from Mapped drive. 2) Also is there any way i get back the result of the command executed or i can only redirect it to a file. Thanks, Siddhartha -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgailer at gmail.com Thu May 15 13:53:01 2008 From: bgailer at gmail.com (bob gailer) Date: Thu, 15 May 2008 07:53:01 -0400 Subject: [python-win32] python-win32 Digest, Vol 62, Issue 13 In-Reply-To: <424b71ec0805150423u15d50f5clde9f7a51b3f06663@mail.gmail.com> References: <424b71ec0805150423u15d50f5clde9f7a51b3f06663@mail.gmail.com> Message-ID: <482C241D.3040909@gmail.com> siddhartha veedaluru wrote: > Hi, > > Sorry about the confusing question. > Thank you. This feels a LOT better. Now we can help. > Here is what i want to achieve > > i have certain updates that i need to install on different machines > These updates are placed in a location and is mapped to all the machines > There will be an exe file say "InstallUpdate.exe" for every update. > > i need to run this exe on all the machines. > i tried running the exe using the following code > > > import wmi, os.path, time > connection = wmi.connect_server (server="orcl", user="Administrator", > password="boss") > c = wmi.WMI (wmi=connection) > pid, result = c.Win32_Process.Create(r'cmd > /c Z:\update01\InstallUpdate.exe > C:\sid.txt') > if result != 0: > print "Update installation failed" > else: > print "Update installation Suceeded" > > Why not just use subprocess.Popen? > > Now i couldn't able to run InstallUpdate.exe as this is on Mapped drive. > If i copy the same update to local drive on the remote machine and run > it, its installing. > > 1) what should be added here inorder to run it from Mapped drive. > 2) Also is there any way i get back the result of the command executed > or i can only redirect it to a file. > > Thanks, > Siddhartha > ------------------------------------------------------------------------ > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -- Bob Gailer 919-636-4239 Chapel Hill, NC From mail at timgolden.me.uk Thu May 15 15:01:45 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 15 May 2008 14:01:45 +0100 Subject: [python-win32] python-win32 Digest, Vol 62, Issue 13 In-Reply-To: <424b71ec0805150423u15d50f5clde9f7a51b3f06663@mail.gmail.com> References: <424b71ec0805150423u15d50f5clde9f7a51b3f06663@mail.gmail.com> Message-ID: <482C3439.1010501@timgolden.me.uk> siddhartha veedaluru wrote: > Sorry about the confusing question. Your rewording is a lot clearer. Thanks. > Here is what i want to achieve > > i have certain updates that i need to install on different machines > These updates are placed in a location and is mapped to all the machines While I think I know what you mean, the last part of this sentence actually doesn't make very much sense. You can share a folder on a Windows machine and you can access that shared folder from another Windows machine, but the concept of mapping [a drive] is a logon-specific one. The machine doesn't have a drive mapping: a user does. > There will be an exe file say "InstallUpdate.exe" for every update. > > i need to run this exe on all the machines. > i tried running the exe using the following code [... snip code ...] The simplest thing, assuming that the orcl\Administrator account has both share-security and file-security access to the .exe is to use the UNC location, which bypasses the issues of drive mapping. As a second hint, there's no need to do the two-line dance to connect to the remote server with credentials. The WMI module can do that for you. import wmi c = wmi.WMI ("orcl", user="Administrator", password="boss") command = r"cmd /c \\svr\share\update01\installupdate.exe > c:\sid.txt" pid, result = c.Win32_Process.Create (CommandLine=cmd) if result != 0: print "Update failed with", result else: print "Update succeeded" Note that the signature of the Win32_Process.Create method... import wmi print wmi.WMI ().Win32_Process.Create ... suggests that you need SeAssignPrimaryToken and SeIncreaseQuotaPrivilege enabled. It may be that the session will have these anyway, but if not you'll need to specify them as part of the connection. > 2) Also is there any way i get back the result of the command executed or i > can only redirect it to a file. I *think* you'll have to redirect it out. Obviously you could redirect it to a log file on the shared updates server, perhaps qualified by the server name ("orcl") or some other unique identifier. TJG From mdriscoll at co.marshall.ia.us Thu May 15 15:05:36 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Thu, 15 May 2008 08:05:36 -0500 Subject: [python-win32] Will wmi can a command on remore host and get the return code In-Reply-To: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> References: <424b71ec0805150047h5e324353oee9816f16cbd75c6@mail.gmail.com> Message-ID: <482C3520.4050109@co.marshall.ia.us> siddhartha veedaluru wrote: > Hi, > > i'm tring to execute a exe that is placed in the mapped network drive > on remote machine > it seems it is not getting recognised. > > How can i run the exe on the mapped network drive > > Thanks, > Siddhartha I would use the subprocess module. import subprocess # replace C:\ with map drive letter or use UNC path subprocess.Popen(r'C:\path\to\exe') Mike From timr at probo.com Thu May 15 19:33:17 2008 From: timr at probo.com (Tim Roberts) Date: Thu, 15 May 2008 10:33:17 -0700 Subject: [python-win32] Attaching Menu to Any App In-Reply-To: <6f3c956b.13c8376a.482c1ca0.44261@o2.pl> References: <3bb293d7.628b5f16.482ab0be.b7341@o2.pl> <011101c8b5a8$f9b019a0$ed104ce0$@com.au> <6f090516.3760cce2.482acb4d.ede11@o2.pl> <482B1A87.4040209@probo.com> <6f3c956b.13c8376a.482c1ca0.44261@o2.pl> Message-ID: <482C73DD.2030600@probo.com> otaeris at o2.pl wrote: > Thanks for your answer. > Yes, this is exactly what I want to acomplish. > Application i'm working on is going to be called from that menu. Plan is to attach it automatically to some apps through running service or some process. > This seems like a silly thing to do. What menu are you going to insert yourself in? As a Windows user, I do not expect to access third-party applications via the standard menus in other applications. There are better ways to do that. If you need an application to be easily available at any time, the right thing to do is to set up a keyboard shortcut. For example, I wrote a "while you were out" application for our office that we all use for taking telephone messages. I create the icon with a shortcut of Alt-Shift-W, and now I can bring it up at any time, no matter what application is currently running. > I red a lot about hooking WinApi but I don't realy know C that much. Writing a simple DLL sounds really easy. > Well, I wouldn't say it's "easy". It's not a lot of code, but it is tricky code. You always have to remind yourself that "this function is running in someone else's process." That means, among other things, you can't use malloc and free, because you don't know what run-time library is available. > How do you mean subclassing a window and overtwritting windowproc can be done in python ? > What *I* said was that it could NOT be done in pure Python, but I was expecting Mark Hammond or Tim Golden to contradict me in such a pessimistic statement. ;) A group at the University of North Carolina has developed several Python packages for automating access to and control of other Windows applications. You might take a look through here: http://www.cs.unc.edu/Research/assist/developer.shtml Their pyAA package seems to allow you to intercept events from another window. However, that still won't allow you to modify their menus. For that, I'm still convinced you'll need a C application. I think you could do what you need with a WH_MSGFILTER hook. This gets called every time a menu event happens (among other places). You would figure out whether the message was for a menu that was opening, and if it was, add yourself to the menu, and subclass the window. Then, when the menu closes, you could undo the subclass and remove yourself from the menu. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Thu May 15 21:12:47 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 15 May 2008 20:12:47 +0100 Subject: [python-win32] Attaching Menu to Any App In-Reply-To: <482C73DD.2030600@probo.com> References: <3bb293d7.628b5f16.482ab0be.b7341@o2.pl> <011101c8b5a8$f9b019a0$ed104ce0$@com.au> <6f090516.3760cce2.482acb4d.ede11@o2.pl> <482B1A87.4040209@probo.com> <6f3c956b.13c8376a.482c1ca0.44261@o2.pl> <482C73DD.2030600@probo.com> Message-ID: <482C8B2F.30902@timgolden.me.uk> Tim Roberts wrote: > What *I* said was that it could NOT be done in pure Python, but I was > expecting Mark Hammond or Tim Golden to contradict me in such a > pessimistic statement. ;) I was trying to hold back from a tirade of pointing out how foolish an idea this was. Why is it that people (a) want to to do intrusive things with other people's interfaces? and (b) want it to be easy and risk-free? (sigh) Tim From mdriscoll at co.marshall.ia.us Thu May 15 22:14:40 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Thu, 15 May 2008 15:14:40 -0500 Subject: [python-win32] Problem creating a shortcut Message-ID: <482C99B0.3090805@co.marshall.ia.us> Hi, I've had this niggling issue from time to time. I want to create a shortcut on the user's desktop to a website that specifically loads Firefox even if Firefox is not the default browser. I usually use COM as it allows very specific settings of the shortcut, such as the Working Directory and the Target Path. However, the following will not work for some reason: import win32com.client import winshell shell = win32com.client.Dispatch('WScript.Shell') userDesktop = winshell.desktop() shortcut = shell.CreateShortCut(userDesktop + '\\MyShortcut.lnk') shortcut.Targetpath = r'"C:\Program Files\Mozilla Firefox\firefox.exe" https:\www.myCompanyWebsite.com\ auth\preauth.php' shortcut.WorkingDirectory = r'C:\Program Files\Mozilla Firefox' shortcut.save() This creates the following target path (which doesn't work for obvious reasons) in the shortcut's Target Path. The extra "C:\" is getting in there somehow... "C:\"C:\Program Files\Mozilla Firefox\firefox.exe" https: \www.myCompanyWebsite.com\ auth\preauth.php" If I leave the website off the TargetPath, it works. If I take the path to Firefox out of the TargetPath, it works too. Is there another method I can use other than creating the shortcut by hand and using the shutil module? Thank you for any ideas. Mike From rwupole at msn.com Thu May 15 22:36:36 2008 From: rwupole at msn.com (Roger Upole) Date: Thu, 15 May 2008 16:36:36 -0400 Subject: [python-win32] Problem creating a shortcut Message-ID: Mike Driscoll wrote: > Hi, > > I've had this niggling issue from time to time. I want to create a > shortcut on the user's desktop to a website that specifically loads > Firefox even if Firefox is not the default browser. > > I usually use COM as it allows very specific settings of the shortcut, > such as the Working Directory and the Target Path. However, the > following will not work for some reason: > > > > import win32com.client > import winshell > > shell = win32com.client.Dispatch('WScript.Shell') > userDesktop = winshell.desktop() > > shortcut = shell.CreateShortCut(userDesktop + '\\MyShortcut.lnk') > shortcut.Targetpath = r'"C:\Program Files\Mozilla Firefox\firefox.exe" > https:\www.myCompanyWebsite.com\ > auth\preauth.php' > shortcut.WorkingDirectory = r'C:\Program Files\Mozilla > Firefox' > shortcut.save() > > > > This creates the following target path (which doesn't work for obvious > reasons) in the shortcut's Target Path. The extra "C:\" is getting in > there somehow... > > "C:\"C:\Program Files\Mozilla Firefox\firefox.exe" https: > \www.myCompanyWebsite.com\ > auth\preauth.php" > > If I leave the website off the TargetPath, it works. If I take the path > to Firefox > out of the TargetPath, it works too. Is there another method I can use > other than > creating the shortcut by hand and using the shutil module? > > Thank you for any ideas. > > Mike I think you need to put the URL in shortcut.Arguments rather than appending it to the executable path. Roger From timr at probo.com Thu May 15 23:22:54 2008 From: timr at probo.com (Tim Roberts) Date: Thu, 15 May 2008 14:22:54 -0700 Subject: [python-win32] Problem creating a shortcut In-Reply-To: <482C99B0.3090805@co.marshall.ia.us> References: <482C99B0.3090805@co.marshall.ia.us> Message-ID: <482CA9AE.1080004@probo.com> Mike Driscoll wrote: > > I've had this niggling issue from time to time. I want to create a > shortcut on the user's desktop to a website that specifically loads > Firefox even if Firefox is not the default browser. > ... > shortcut = shell.CreateShortCut(userDesktop + '\\MyShortcut.lnk') > shortcut.Targetpath = r'"C:\Program Files\Mozilla Firefox\firefox.exe" > https:\www.myCompanyWebsite.com\ > auth\preauth.php' > shortcut.WorkingDirectory = r'C:\Program Files\Mozilla > Firefox' > shortcut.save() > > Do you understand that it is not safe to assume that Firefox lives in "C:\Program Files\Mozilla Firefox"? I often override my application install directories to keep the paths short, so I put it in "C:\Apps\Firefox". Plus, the "Program Files" path name is localized on the international versions of Windows. You'll need to dig in the registry, in HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox. Fetch the "CurrentVersion" string value, then look inside that key, in Main, and fetch the PathToExe string. Something like this: ffkey = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Mozilla\\Mozilla Firefox') ffver = _winreg.QueryValueEx( ffkey, 'CurrentVersion' )[0] print ffver ffmainkey = _winreg.OpenKey( ffkey, sub + "\\Main" ) ffpath = _winreg.QueryValueEx( ffmainkey, 'PathToExe' )[0] _winreg.CloseKey( ffkey ) _winreg.CloseKey( ffmainkey ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mhammond at skippinet.com.au Fri May 16 01:45:54 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Fri, 16 May 2008 09:45:54 +1000 Subject: [python-win32] Problem creating a shortcut In-Reply-To: <482CA9AE.1080004@probo.com> References: <482C99B0.3090805@co.marshall.ia.us> <482CA9AE.1080004@probo.com> Message-ID: <009d01c8b6e5$d0cb4e90$7261ebb0$@com.au> Tim wrote: > Plus, the "Program Files" path name is localized on > the international versions of Windows. Obviously Tim is correct that you can't assume FF is in Program Files, but if you really did want the Program Files dir for other reasons, the way to get it is: >>> from win32com.shell import shell, shellcon >>> shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_PROGRAM_FILES) u'C:\\Program Files' >>> Also, IIRC, shortcuts can include environment strings, so specifying "%ProgramFiles%" in the target might also work (but again, only if you are sure you really want Program Files :) Mark From tnelson at onresolve.com Thu May 15 17:17:28 2008 From: tnelson at onresolve.com (Trent Nelson) Date: Thu, 15 May 2008 16:17:28 +0100 Subject: [python-win32] [OT] Anyone happen to know the system-wide limit of HANDLEs in Windows 2000 Server? Message-ID: <6167796BFEB5D0438720AC212E89A6B0078657BB@exchange.onresolve.com> I'm debugging a weird/sporadic COM/ActiveX error with an application on a client's site that's recently been 'migrated' to Citrix Metaframe on Windows 2000 Server. I'm starting to think we may be hitting the system-wide limit for how many HANDLEs can be created across all processes every so often, which always causes weird and wonderful behaviour. However, I can't remember what the system-wide limit is, and stfw'ing didn't turn up any clues. I recall reading something in a GDI programming book recently where the author used brute force to demonstrate that the system limit was around X handles -- but I can't remember what X was, I think it was around 43,000, but I'm not sure. Anyone here happen to know off the top of their head? Trent. From rwupole at msn.com Fri May 16 03:09:45 2008 From: rwupole at msn.com (Roger Upole) Date: Thu, 15 May 2008 21:09:45 -0400 Subject: [python-win32] Need reviews for a patch in win32file for TransmitFile and ConnectEx Message-ID: One other thing, TransmitFile isn't checking the return value. It should probably do something like ConnectEx does, ie call WSAGetLastError and raise an exception for anything other than ERROR_IO_PENDING. Roger From mail at timgolden.me.uk Fri May 16 13:09:46 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 16 May 2008 12:09:46 +0100 Subject: [python-win32] Problem creating a shortcut Message-ID: <482D6B7A.6040808@timgolden.me.uk> Sorry, missed this one going through. Looks like Roger's hit the nail on the head, though. Bizarre behaviour by the IShellLink interface: I can't find any kind of reference to this but I assume that since the Path attribute of the link should *only* contain an executable, there's no need for the quotes -- which then confuse it when they're there as it tries to make the executable into an absolute path. One small comment, Mike. Since you're using the winshell module -- which I assume is the one from my site -- why not use its CreateShortcut function? It's basically just a light wrapper around the IShellLink functionality which someone else mentioned: import os, sys import winshell winshell.CreateShortcut ( Path=os.path.join (winshell.desktop (), "shortcut.lnk"), Target=r"c:\Program Files\Mozilla Firefox\firefox.exe", Arguments="http://localhost", Description="Open http://localhost with Firefox" ) But maybe you're using the WScript.Shell functionality elsewhere as well? TJG From mdriscoll at co.marshall.ia.us Fri May 16 15:48:52 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Fri, 16 May 2008 08:48:52 -0500 Subject: [python-win32] Problem creating a shortcut In-Reply-To: <482CA9AE.1080004@probo.com> References: <482C99B0.3090805@co.marshall.ia.us> <482CA9AE.1080004@probo.com> Message-ID: <482D90C4.1080004@co.marshall.ia.us> Tim, >
Mike > Driscoll wrote: >> >> I've had this niggling issue from time to time. I want to create a >> shortcut on the user's desktop to a website that specifically loads >> Firefox even if Firefox is not the default browser. >> ... >> shortcut = shell.CreateShortCut(userDesktop + '\\MyShortcut.lnk') >> shortcut.Targetpath = r'"C:\Program Files\Mozilla Firefox\firefox.exe" >> https:\www.myCompanyWebsite.com\ >> auth\preauth.php' >> shortcut.WorkingDirectory = r'C:\Program Files\Mozilla >> Firefox' >> shortcut.save() >> >> > > Do you understand that it is not safe to assume that Firefox lives in > "C:\Program Files\Mozilla Firefox"? I often override my application > install directories to keep the paths short, so I put it in > "C:\Apps\Firefox". Plus, the "Program Files" path name is localized > on the international versions of Windows. I guess I should have described my environment a little more. This is for a logon script at a business. The user's have no control over where Firefox resides and if they happen to uninstall it or do not have it in the first place, one of my other scripts will install it for them in the background. The reason is quite simple. We use Zimbra which runs much better in Firefox than any other browser we've tested. But you and the others are correct. If this had been an application, then I wouldn't have done this the way that I am. > > You'll need to dig in the registry, in > HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox. Fetch the > "CurrentVersion" string value, then look inside that key, in Main, and > fetch the PathToExe string. Something like this: > > ffkey = _winreg.OpenKey( _winreg.HKEY_LOCAL_MACHINE, > 'SOFTWARE\\Mozilla\\Mozilla Firefox') > ffver = _winreg.QueryValueEx( ffkey, 'CurrentVersion' )[0] > print ffver > ffmainkey = _winreg.OpenKey( ffkey, sub + "\\Main" ) > ffpath = _winreg.QueryValueEx( ffmainkey, 'PathToExe' )[0] > _winreg.CloseKey( ffkey ) > _winreg.CloseKey( ffmainkey ) > Thanks for the advice, Mike From mdriscoll at co.marshall.ia.us Fri May 16 15:49:53 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Fri, 16 May 2008 08:49:53 -0500 Subject: [python-win32] Problem creating a shortcut In-Reply-To: References: Message-ID: <482D9101.7080904@co.marshall.ia.us> Roger, >
Mike > Driscoll wrote: >> Hi, >> >> I've had this niggling issue from time to time. I want to create a >> shortcut on the user's desktop to a website that specifically loads >> Firefox even if Firefox is not the default browser. >> >> I usually use COM as it allows very specific settings of the shortcut, >> such as the Working Directory and the Target Path. However, the >> following will not work for some reason: >> >> >> >> import win32com.client >> import winshell >> >> shell = win32com.client.Dispatch('WScript.Shell') >> userDesktop = winshell.desktop() >> >> shortcut = shell.CreateShortCut(userDesktop + '\\MyShortcut.lnk') >> shortcut.Targetpath = r'"C:\Program Files\Mozilla Firefox\firefox.exe" >> https:\www.myCompanyWebsite.com\ >> auth\preauth.php' >> shortcut.WorkingDirectory = r'C:\Program Files\Mozilla >> Firefox' >> shortcut.save() >> >> >> >> This creates the following target path (which doesn't work for >> obvious reasons) in the shortcut's Target Path. The extra "C:\" is >> getting in there somehow... >> >> "C:\"C:\Program Files\Mozilla Firefox\firefox.exe" https: >> \www.myCompanyWebsite.com\ >> auth\preauth.php" >> >> If I leave the website off the TargetPath, it works. If I take the >> path to Firefox >> out of the TargetPath, it works too. Is there another method I can >> use other than >> creating the shortcut by hand and using the shutil module? >> >> Thank you for any ideas. >> >> Mike > > I think you need to put the URL in shortcut.Arguments rather than > appending it to the executable path. > > Roger > > >
Someone on c.l.py pointed this out too. I was unaware that that existed. It works great though. Thanks a lot! Mike From larry.bates at websafe.com Fri May 16 15:57:44 2008 From: larry.bates at websafe.com (Larry Bates) Date: Fri, 16 May 2008 08:57:44 -0500 Subject: [python-win32] Attaching Menu to Any App In-Reply-To: <482C8B2F.30902@timgolden.me.uk> References: <3bb293d7.628b5f16.482ab0be.b7341@o2.pl> <011101c8b5a8$f9b019a0$ed104ce0$@com.au> <6f090516.3760cce2.482acb4d.ede11@o2.pl> <482B1A87.4040209@probo.com> <6f3c956b.13c8376a.482c1ca0.44261@o2.pl> <482C73DD.2030600@probo.com> <482C8B2F.30902@timgolden.me.uk> Message-ID: Tim Golden wrote: > Tim Roberts wrote: >> What *I* said was that it could NOT be done in pure Python, but I was >> expecting Mark Hammond or Tim Golden to contradict me in such a >> pessimistic statement. ;) > > I was trying to hold back from a tirade of pointing > out how foolish an idea this was. Why is it that people > (a) want to to do intrusive things with other people's > interfaces? and (b) want it to be easy and risk-free? > > (sigh) > > Tim While I agree with Tim that unilaterally trying to add something to another applications menu will be a lesson in futility, many Windows applications have clearly defined APIs for adding items to their menus or toolbars (Microsoft Office, etc). A good place to start would be to look at Mark Hammond's excellent SpamBayes plug-in for Outlook on how to add utilities to such applications. -Larry From Kyle.Rickey at bakerhughes.com Fri May 16 17:35:45 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Fri, 16 May 2008 10:35:45 -0500 Subject: [python-win32] Volume Serial Number Message-ID: How do I get the volume serial number for a drive? For example in the cmd prompt issuing this: C:\>vol C: Volume in drive C is LABEL Volume Serial Number is FFFF-0000 Is the volume serial number wrapped by pywin32? I found the function win32api.GetVolumeInformation, but it doesn't seem to return what I want. -Kyle Rickey -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdahlstrom at directedge.com Fri May 16 18:03:22 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Fri, 16 May 2008 12:03:22 -0400 Subject: [python-win32] Volume Serial Number References: Message-ID: only way I know how to do it is import os out = os.popen("dir SomethingThatDoesntExist") print out ________________________________ From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Rickey, Kyle W Sent: Friday, May 16, 2008 11:36 AM To: python-win32 at python.org Subject: [python-win32] Volume Serial Number How do I get the volume serial number for a drive? For example in the cmd prompt issuing this: C:\>vol C: Volume in drive C is LABEL Volume Serial Number is FFFF-0000 Is the volume serial number wrapped by pywin32? I found the function win32api.GetVolumeInformation, but it doesn't seem to return what I want. -Kyle Rickey DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Fri May 16 19:32:01 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Fri, 16 May 2008 10:32:01 -0700 Subject: [python-win32] Volume Serial Number Message-ID: <8249c4ac0805161032w70dd8442ha3d942a086d4a25e@mail.gmail.com> That's not the serial number of the drive- as assigned by the drive manufacturer. If you want the SN from the drive manufacturer, you will need to issue an IOCTL ATA Passthrough command which sends the ATA Identify Device command to the drive. Unless the Winapi has a wrapper for that functionality, you can't do that via Python. You would have to install the Windows SDK to compile a tiny program to issue the Identify Device command and pull out the SN from the data coming back, which is only 512 bytes. This would have to be written in C. It's not difficult to do and the program would only require less than100 lines of C code. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri May 16 19:33:39 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 16 May 2008 10:33:39 -0700 Subject: [python-win32] Volume Serial Number In-Reply-To: References: Message-ID: <482DC573.4080802@probo.com> Rickey, Kyle W wrote: > > How do I get the volume serial number for a drive? For example in the > cmd prompt issuing this: > > > > C:\>vol C: > > Volume in drive C is LABEL > > Volume Serial Number is FFFF-0000 > > > > Is the volume serial number wrapped by pywin32? I found the function > win32api.GetVolumeInformation, but it doesn?t seem to return what I want. > Yes, actually, it does. The second item in the tuple it returns is the VSN as a 32-bit binary value. You were probably confused because Python showed it to you as a signed decimal integer. If your VSN is really FFFF-0000, then it probably showed you -65535. If you print that in hex, you get -FFFF, and if you treat that as unsigned, you get FFFF0000. I wish I knew a better way to do the signed/unsigned mangling, but try this: def UnsignedHex( v ): if v >= 0: return '%08X' % v return '%08X' % (0x100000000 + v ) print UnsignedHex( win32api.GetVolumeInformation('C:\\')[1] ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Fri May 16 19:34:28 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 16 May 2008 10:34:28 -0700 Subject: [python-win32] Volume Serial Number In-Reply-To: References: Message-ID: <482DC5A4.5020302@probo.com> Dahlstrom, Roger wrote: > only way I know how to do it is > > import os > out = os.popen("dir SomethingThatDoesntExist") > print out The "vol" command was designed for this purpose: out = os.popen("vol") although GetVolumeInformation is a better way. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From cappy2112 at gmail.com Fri May 16 19:35:47 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Fri, 16 May 2008 10:35:47 -0700 Subject: [python-win32] Volume Serial Number Message-ID: <8249c4ac0805161035h1f7e0671m6517f01b19436404@mail.gmail.com> Message: 5 > Date: Fri, 16 May 2008 10:35:45 -0500 > From: "Rickey, Kyle W" > Subject: [python-win32] Volume Serial Number > To: > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > >>How do I get the volume serial number for a drive? For example in the > >>cmd prompt issuing this: > > It looks like Tim Golden has a way to do what you want- via Python! http://tgolden.sc.sabren.com/python/win32_how_do_i/see_if_two_files_are_the_same_file.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri May 16 19:40:17 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 16 May 2008 10:40:17 -0700 Subject: [python-win32] [OT] Anyone happen to know the system-wide limit of HANDLEs in Windows 2000 Server? In-Reply-To: <6167796BFEB5D0438720AC212E89A6B0078657BB@exchange.onresolve.com> References: <6167796BFEB5D0438720AC212E89A6B0078657BB@exchange.onresolve.com> Message-ID: <482DC701.1040704@probo.com> Trent Nelson wrote: > I'm debugging a weird/sporadic COM/ActiveX error with an application on a client's site that's recently been 'migrated' to Citrix Metaframe on Windows 2000 Server. I'm starting to think we may be hitting the system-wide limit for how many HANDLEs can be created across all processes every so often, which always causes weird and wonderful behaviour. > > However, I can't remember what the system-wide limit is, and stfw'ing didn't turn up any clues. I recall reading something in a GDI programming book recently where the author used brute force to demonstrate that the system limit was around X handles -- but I can't remember what X was, I think it was around 43,000, but I'm not sure. > > Anyone here happen to know off the top of their head? > 10,000 per process. 32,700 system-wide. That's window manager objects -- window handles. GDI object handles are separate. http://blogs.msdn.com/oldnewthing/archive/2007/07/18/3926581.aspx http://msdn.microsoft.com/en-us/library/ms725486.aspx http://msdn.microsoft.com/en-us/library/ms724291.aspx -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mdriscoll at co.marshall.ia.us Fri May 16 19:43:19 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Fri, 16 May 2008 12:43:19 -0500 Subject: [python-win32] Problem creating a shortcut In-Reply-To: <482D6B7A.6040808@timgolden.me.uk> References: <482D6B7A.6040808@timgolden.me.uk> Message-ID: <482DC7B7.4040004@co.marshall.ia.us> Tim Golden wrote: >
Sorry, > missed this one going through. Looks like > Roger's hit the nail on the head, though. Bizarre > behaviour by the IShellLink interface: I can't find > any kind of reference to this but I assume that > since the Path attribute of the link should *only* > contain an executable, there's no need for the > quotes -- which then confuse it when they're there > as it tries to make the executable into an absolute > path. > > One small comment, Mike. Since you're using the > winshell module -- which I assume is the one from > my site -- why not use its CreateShortcut function? > It's basically just a light wrapper around the IShellLink > functionality which someone else mentioned: > > > import os, sys > import winshell > > winshell.CreateShortcut ( > Path=os.path.join (winshell.desktop (), "shortcut.lnk"), > Target=r"c:\Program Files\Mozilla Firefox\firefox.exe", > Arguments="http://localhost", > Description="Open http://localhost with Firefox" > ) > > > > But maybe you're using the WScript.Shell functionality > elsewhere as well? > > TJG > > >
Good point. I am using your module (thanks!). Somehow I missed it's shortcut creating abilities. I do use the WScript.Shell earlier in my script, but I think it's just for other types of shortcut creation. I'll have to look. It would be good not to have to import extra stuff. Mike From timr at probo.com Fri May 16 19:43:05 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 16 May 2008 10:43:05 -0700 Subject: [python-win32] Volume Serial Number In-Reply-To: <8249c4ac0805161035h1f7e0671m6517f01b19436404@mail.gmail.com> References: <8249c4ac0805161035h1f7e0671m6517f01b19436404@mail.gmail.com> Message-ID: <482DC7A9.2020604@probo.com> Tony Cappellini wrote: > > >>How do I get the volume serial number for a drive? For example > in the > >>cmd prompt issuing this: > > It looks like Tim Golden has a way to do what you want- via Python! > http://tgolden.sc.sabren.com/python/win32_how_do_i/see_if_two_files_are_the_same_file.html Tim Golden has a way to do just about everything, but this particular snippet has nothing to do with the original question. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Fri May 16 19:45:05 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 16 May 2008 18:45:05 +0100 Subject: [python-win32] Volume Serial Number In-Reply-To: References: Message-ID: <482DC821.4000905@timgolden.me.uk> Rickey, Kyle W wrote: > How do I get the volume serial number for a drive? For example in the > cmd prompt issuing this: WMI to the rescue? import wmi for volume in wmi.WMI ().Win32_LogicalDisk (): print volume.Caption, "=>", volume.VolumeSerialNumber TJG From Kyle.Rickey at bakerhughes.com Fri May 16 20:18:49 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Fri, 16 May 2008 13:18:49 -0500 Subject: [python-win32] Volume Serial Number [SOLVED] In-Reply-To: <482DC821.4000905@timgolden.me.uk> References: <482DC821.4000905@timgolden.me.uk> Message-ID: Thanks to all for your responses. I tried both methods from each Tim. :) > Yes, actually, it does. The second item in the tuple it returns is the > VSN as a 32-bit binary value. Ahh, now I understand where I messed up, your code example enlightened me. > WMI to the rescue? > > import wmi > > for volume in wmi.WMI ().Win32_LogicalDisk (): > print volume.Caption, "=>", volume.VolumeSerialNumber > > This example also worked quite well. In addition to that there's lots of juicy information available from the 'volume' object. Thanks for that! > If you want the SN from the drive manufacturer, you will need to issue an > IOCTL ATA Passthrough command which sends the ATA Identify Device command > to the drive. Unless the Winapi has a wrapper for that functionality, you > can't do that via Python. Thanks for that as well, although not what I was looking for, I'll save that for a rainy day. :) Just for message consistency, I've reposted Tim Robert's example below: def UnsignedHex( v ): if v >= 0: return '%08X' % v return '%08X' % (0x100000000 + v ) print UnsignedHex( win32api.GetVolumeInformation('C:\\')[1] ) Thanks again to everyone for your help. -Kyle Rickey -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden Sent: Friday, May 16, 2008 12:45 PM Cc: python-win32 at python.org Subject: Re: [python-win32] Volume Serial Number Rickey, Kyle W wrote: > How do I get the volume serial number for a drive? For example in the > cmd prompt issuing this: WMI to the rescue? import wmi for volume in wmi.WMI ().Win32_LogicalDisk (): print volume.Caption, "=>", volume.VolumeSerialNumber TJG _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 From cappy2112 at gmail.com Fri May 16 20:30:42 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Fri, 16 May 2008 11:30:42 -0700 Subject: [python-win32] Volume Serial Number Message-ID: <8249c4ac0805161130y383b2122s1c4a8a380d559367@mail.gmail.com> >>Tim Golden has a way to do just about everything, but this particular >>snippet has nothing to do with the original question. def get_unique_id (hFile): ( attributes, created_at, accessed_at, written_at, volume, file_hi, file_lo, n_links, index_hi, index_lo ) = win32file.GetFileInformationByHandle (hFile) return volume, index_hi, index_lo The link I posted certainly has a misleading name, but the code above (from that link) returns the volume SN. Is the fifth item returned from GetFileInformationByHandle() not the Volume SN? [0] *int* : dwFileAttributes [1] *PyTime * : ftCreationTime [2] *PyTime * : ftLastAccessTime [3] *PyTime * : ftLastWriteTime [4] *int* : dwVolumeSerialNumber -------------- next part -------------- An HTML attachment was scrubbed... URL: From python at bdurham.com Fri May 16 20:37:02 2008 From: python at bdurham.com (python at bdurham.com) Date: Fri, 16 May 2008 14:37:02 -0400 Subject: [python-win32] Is WMI ever disabled? In-Reply-To: References: <482DC821.4000905@timgolden.me.uk> Message-ID: <1210963022.30585.1253575235@webmail.messagingengine.com> I've been enjoying a lot of the WMI examples posted on this mailing list. Does anyone know if WMI is ever fully or partially disabled by corporate customers, eg. as a way to secure workstations? I'm trying to figure out how confident one can be about assuming WMI functionality will be available on real-world 'locked-down' corporate workstations. Thank you, Malcolm From timr at probo.com Fri May 16 21:58:26 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 16 May 2008 12:58:26 -0700 Subject: [python-win32] Volume Serial Number In-Reply-To: <8249c4ac0805161130y383b2122s1c4a8a380d559367@mail.gmail.com> References: <8249c4ac0805161130y383b2122s1c4a8a380d559367@mail.gmail.com> Message-ID: <482DE762.4060808@probo.com> Tony Cappellini wrote: > >>Tim Golden has a way to do just about everything, but this particular > >>snippet has nothing to do with the original question. > > def get_unique_id (hFile): > ( > attributes, > > created_at, accessed_at, written_at, > volume, > file_hi, file_lo, > n_links, > index_hi, index_lo > ) = win32file.GetFileInformationByHandle (hFile) > return volume, index_hi, index_lo > > The link I posted certainly has a misleading name, but the code above (from that link) returns the volume SN. > Is the fifth item returned from GetFileInformationByHandle() not the Volume SN? > You are quite correct, I apologize. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Fri May 16 22:00:30 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 16 May 2008 13:00:30 -0700 Subject: [python-win32] Is WMI ever disabled? In-Reply-To: <1210963022.30585.1253575235@webmail.messagingengine.com> References: <482DC821.4000905@timgolden.me.uk> <1210963022.30585.1253575235@webmail.messagingengine.com> Message-ID: <482DE7DE.7010806@probo.com> python at bdurham.com wrote: > I've been enjoying a lot of the WMI examples posted on this mailing > list. > > Does anyone know if WMI is ever fully or partially disabled by corporate > customers, eg. as a way to secure workstations? > I would expect quite the opposite. In corporate situations, WMI is often exploited quite heavily for monitoring, logging, and administration. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Fri May 16 22:45:12 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 16 May 2008 21:45:12 +0100 Subject: [python-win32] Is WMI ever disabled? In-Reply-To: <1210963022.30585.1253575235@webmail.messagingengine.com> References: <482DC821.4000905@timgolden.me.uk> <1210963022.30585.1253575235@webmail.messagingengine.com> Message-ID: <482DF258.8070605@timgolden.me.uk> python at bdurham.com wrote: > I've been enjoying a lot of the WMI examples posted on this mailing > list. > > Does anyone know if WMI is ever fully or partially disabled by corporate > customers, eg. as a way to secure workstations? > > I'm trying to figure out how confident one can be about assuming WMI > functionality will be available on real-world 'locked-down' corporate > workstations. Interesting because of course WMI can be used to do so many things remotely that it might be considered a security risk. You can secure it down to namespace level but no lower than that, I think: if a user has access to, say, view Volume labels, then they can create new processes (altho' there are privilege implications on some such things). In short, though, I've never heard of an environment where it is disabled since its potential for remote administration and so on is so useful. TJG From patrick at raptr.com Sat May 17 21:58:38 2008 From: patrick at raptr.com (Patrick Li) Date: Sat, 17 May 2008 12:58:38 -0700 Subject: [python-win32] win32api.GetShortPathName() leaks memory? Message-ID: <2b5a48740805171258y132237anca9fdf732685e8a1@mail.gmail.com> Hi, I'm running into some memory leak issue when running the win32pi.GetShortPathName function. Basically I've got a daemon that will perform this function on lots of long windows path names. Over time, it looks like the memory footprint increases substantially. You can reproduce it by simply launching this in your python interpreter: import win32api for x in xrange(1000000): win32api.GetShortPathName("c:\\documents and settings\\some directory\\name") You will see in your windows task manager that the memory usage shoots up. Anyone have any idea on how to get around this problem? I thought about writing my own version of GetShortPathName, but so far I haven't been able to find any source code/docs online on the proper logic to generate the short name. Thanks, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From rwupole at msn.com Sat May 17 22:29:05 2008 From: rwupole at msn.com (Roger Upole) Date: Sat, 17 May 2008 16:29:05 -0400 Subject: [python-win32] win32api.GetShortPathName() leaks memory? Message-ID: This has been fixed in CVS, and will be corrected in the next release. win32api.FindFiles will also return the short file name, although only for the final component in the path. Roger From mhammond at skippinet.com.au Sun May 18 03:50:48 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sun, 18 May 2008 11:50:48 +1000 Subject: [python-win32] *****SPAM***** win32api.GetShortPathName() leaks memory? In-Reply-To: References: Message-ID: <021101c8b889$9b2d3280$d1879780$@com.au> Digging a little more, the spamassassin issue appears to be https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5666, but sadly the fix doesn't seem to yet appear in a released version, so I can't ask my ISP to upgrade. Cheers, Mark > -----Original Message----- > From: Roger Upole [mailto:rwupole at msn.com] > Sent: Sunday, 18 May 2008 6:29 AM > To: python-win32 at python.org > Subject: *****SPAM***** [python-win32] win32api.GetShortPathName() > leaks memory? > > Spam detection software, running on the system "vsmail2.per.eftel.com", > has identified this incoming email as possible spam. The original > message has been attached to this so you can view it (if it isn't spam) > or label similar future email. If you have any questions, see the > administrator of that system for details. > > Content preview: This has been fixed in CVS, and will be corrected in > the next > release. win32api.FindFiles will also return the short file name, > although > only for the final component in the path. Roger [...] > > Content analysis details: (5.7 points, 5.0 required) > > pts rule name description > ---- ---------------------- ------------------------------------------- > ------- > 1.5 MSGID_FROM_MTA_HEADER Message-Id was added by a relay > 4.2 FORGED_MUA_OUTLOOK Forged mail pretending to be from MS > Outlook > From mhammond at skippinet.com.au Sun May 18 04:14:32 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sun, 18 May 2008 12:14:32 +1000 Subject: [python-win32] *****SPAM***** win32api.GetShortPathName() leaks memory? In-Reply-To: <021101c8b889$9b2d3280$d1879780$@com.au> References: <021101c8b889$9b2d3280$d1879780$@com.au> Message-ID: <021501c8b88c$ebb837b0$c328a710$@com.au> Oops - I'm not having a good day - this wasn't supposed to be CC'd to the list. No harm done though - in case anyone is interested, my ISP's spam filter is picking up Roger's email due to a combination of his MUA and a spamassassin bug :( Sorry for the noise... Mark > -----Original Message----- > From: python-win32-bounces at python.org [mailto:python-win32- > bounces at python.org] On Behalf Of Mark Hammond > Sent: Sunday, 18 May 2008 11:51 AM > To: 'Roger Upole'; python-win32 at python.org > Subject: Re: [python-win32] *****SPAM***** win32api.GetShortPathName() > leaks memory? > > Digging a little more, the spamassassin issue appears to be > https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5666, but sadly > the fix doesn't seem to yet appear in a released version, so I can't > ask my ISP to upgrade. > > Cheers, > > Mark > > > -----Original Message----- > > From: Roger Upole [mailto:rwupole at msn.com] > > Sent: Sunday, 18 May 2008 6:29 AM > > To: python-win32 at python.org > > Subject: *****SPAM***** [python-win32] win32api.GetShortPathName() > > leaks memory? > > > > Spam detection software, running on the system > "vsmail2.per.eftel.com", > > has identified this incoming email as possible spam. The original > > message has been attached to this so you can view it (if it isn't > spam) > > or label similar future email. If you have any questions, see the > > administrator of that system for details. > > > > Content preview: This has been fixed in CVS, and will be corrected > in > > the next > > release. win32api.FindFiles will also return the short file name, > > although > > only for the final component in the path. Roger [...] > > > > Content analysis details: (5.7 points, 5.0 required) > > > > pts rule name description > > ---- ---------------------- ----------------------------------------- > -- > > ------- > > 1.5 MSGID_FROM_MTA_HEADER Message-Id was added by a relay > > 4.2 FORGED_MUA_OUTLOOK Forged mail pretending to be from MS > > Outlook > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From lgautier at gmail.com Sun May 18 17:55:19 2008 From: lgautier at gmail.com (Laurent Gautier) Date: Sun, 18 May 2008 23:55:19 +0800 Subject: [python-win32] Error while trying to compile a C module using MinGW Message-ID: <27d1e6020805180855xdb0da67qdb907ecf4355402f@mail.gmail.com> Hi, I am experiencing problems while trying to build a C module. I have been through many explanations of how to setup a Windows XP box and I studied them carefully, and unsuccessfully, before posting here. For example, when trying to build the minimal example on wikipedia http://en.wikibooks.org/wiki/Python_Programming/Extending_with_C#A_minimal_example I get: C:\Documents and Settings\Bozo\>python setup.py build -g running build running build_ext building 'hello' extension creating build\temp.win32-2.5\Debug gcc -mno-cygwin -mdll -O -Wall -g -IC:\Python25\include -IC:\Python25\PC -c hellomodule.c -o build\temp.win32-2.5\Debug\hellomodule.o error: command 'gcc' failed: No such file or directory The odd thing is that when I copy/paste the line gcc -mno-cygwin -mdll -O -Wall -g -IC:\Python25\include -IC:\Python25\PC -c hellomodule.c -o build\temp.win32-2.5\Debug\hellomodule.o into the very same DOS shell that gave the error, that line runs just fine. Any hint would be greatly appreciated. Thanks, Laurent From lgautier at gmail.com Sun May 18 20:02:53 2008 From: lgautier at gmail.com (Laurent Gautier) Date: Mon, 19 May 2008 02:02:53 +0800 Subject: [python-win32] Error while trying to compile a C module using MinGW In-Reply-To: <27d1e6020805180855xdb0da67qdb907ecf4355402f@mail.gmail.com> References: <27d1e6020805180855xdb0da67qdb907ecf4355402f@mail.gmail.com> Message-ID: <27d1e6020805181102y4a98424auc68de51db4f92337@mail.gmail.com> Some follow-up. When having a minimal "Path" variable defined (that is with only C:\MinGW\bin), "python setup.py build" does work. There might be something in my complete regular Path that confuses distutils. 2008/5/18 Laurent Gautier : > Hi, > > I am experiencing problems while trying to build a C module. > > I have been through many explanations of how to setup a Windows XP box > and I studied them carefully, and unsuccessfully, before posting here. > > For example, when trying to build the minimal example on wikipedia > http://en.wikibooks.org/wiki/Python_Programming/Extending_with_C#A_minimal_example > > I get: > > C:\Documents and Settings\Bozo\>python setup.py build -g > running build > running build_ext > building 'hello' extension > creating build\temp.win32-2.5\Debug > gcc -mno-cygwin -mdll -O -Wall -g -IC:\Python25\include > -IC:\Python25\PC -c hellomodule.c -o > build\temp.win32-2.5\Debug\hellomodule.o > error: command 'gcc' failed: No such file or directory > > The odd thing is that when I copy/paste the line > gcc -mno-cygwin -mdll -O -Wall -g -IC:\Python25\include > -IC:\Python25\PC -c hellomodule.c -o > build\temp.win32-2.5\Debug\hellomodule.o > into the very same DOS shell that gave the error, that line runs just fine. > > > > Any hint would be greatly appreciated. > > > Thanks, > > > Laurent > From singhai.nish at gmail.com Mon May 19 16:24:11 2008 From: singhai.nish at gmail.com (kNish) Date: Mon, 19 May 2008 19:54:11 +0530 Subject: [python-win32] maya and python Message-ID: <81bfef2e0805190724v76d3df2y775b496f2e3119e4@mail.gmail.com> Hi, How good is python 3rd party plugin like wxpython compatible with maya 2008 that is running on windows 64. Do you say it is a good idea to run scripts on it and expect a smooth function flow. BRgds, kNish -------------- next part -------------- An HTML attachment was scrubbed... URL: From singhai.nish at gmail.com Mon May 19 20:14:06 2008 From: singhai.nish at gmail.com (kNish) Date: Mon, 19 May 2008 23:44:06 +0530 Subject: [python-win32] maya and python In-Reply-To: <81bfef2e0805190724v76d3df2y775b496f2e3119e4@mail.gmail.com> References: <81bfef2e0805190724v76d3df2y775b496f2e3119e4@mail.gmail.com> Message-ID: <81bfef2e0805191114p783809d1u61e50b108fbfab10@mail.gmail.com> I need to call it from inside Maya. On Mon, May 19, 2008 at 7:54 PM, kNish wrote: > Hi, > > How good is python 3rd party plugin like wxpython compatible > with maya 2008 that is running on windows 64. Do you say it is a good idea > to run scripts on it and expect a smooth function flow. > > BRgds, > > > kNish > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Tue May 20 00:25:56 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 19 May 2008 15:25:56 -0700 Subject: [python-win32] using the wave module for reading wave files Message-ID: <8249c4ac0805191525p386726fct25b6bcd988664047@mail.gmail.com> In the wave module, is the term "frame" synonymous with sample? That is, does the method wave.readframes(1) read a sample that is getsampwidth() bits wide, where each sample was sampled at the frequency found at wave.getframerate() ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerdusvanzyl at gmail.com Tue May 20 10:42:51 2008 From: gerdusvanzyl at gmail.com (Gerdus van Zyl) Date: Tue, 20 May 2008 10:42:51 +0200 Subject: [python-win32] maya and python In-Reply-To: <81bfef2e0805191114p783809d1u61e50b108fbfab10@mail.gmail.com> References: <81bfef2e0805190724v76d3df2y775b496f2e3119e4@mail.gmail.com> <81bfef2e0805191114p783809d1u61e50b108fbfab10@mail.gmail.com> Message-ID: <91882ea90805200142o74bf353dy32d0aa0e2ceffb43@mail.gmail.com> Depends on how python is integrated with maya, are there other plugins that use external GUI libraries? You might want to ask a maya list they will know better. On Mon, May 19, 2008 at 8:14 PM, kNish wrote: > I need to call it from inside Maya. > > > > On Mon, May 19, 2008 at 7:54 PM, kNish wrote: >> >> Hi, >> >> How good is python 3rd party plugin like wxpython compatible >> with maya 2008 that is running on windows 64. Do you say it is a good idea >> to run scripts on it and expect a smooth function flow. >> >> BRgds, >> >> >> kNish > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > From otaeris at o2.pl Tue May 20 12:19:55 2008 From: otaeris at o2.pl (otaeris at o2.pl) Date: Tue, 20 May 2008 12:19:55 +0200 Subject: [python-win32] =?utf-8?q?maya_and_python?= In-Reply-To: <91882ea90805200142o74bf353dy32d0aa0e2ceffb43@mail.gmail.com> References: <81bfef2e0805190724v76d3df2y775b496f2e3119e4@mail.gmail.com> <81bfef2e0805191114p783809d1u61e50b108fbfab10@mail.gmail.com> <91882ea90805200142o74bf353dy32d0aa0e2ceffb43@mail.gmail.com> Message-ID: <67378d78.76620ce5.4832a5cb.cbc98@o2.pl> To use wx in maya you have to add wxPython folder path into mayapython sys.path. Python 2.5 is integrated with maya 2008, so it should work just fine. You can do quite a lot with maya UI using maya.cmds. cgBartek > Depends on how python is integrated with maya, are there other plugins > that use external GUI libraries? You might want to ask a maya list > they will know better. > > On Mon, May 19, 2008 at 8:14 PM, kNish wrote: > > I need to call it from inside Maya. > > > > > > > > On Mon, May 19, 2008 at 7:54 PM, kNish wrote: > >> > >> Hi, > >> > >> How good is python 3rd party plugin like wxpython compatible > >> with maya 2008 that is running on windows 64. Do you say it is a good idea > >> to run scripts on it and expect a smooth function flow. > >> > >> BRgds, > >> > >> > >> kNish > > > > > > _______________________________________________ > > python-win32 mailing list > > python-win32 at python.org > > http://mail.python.org/mailman/listinfo/python-win32 > > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From mugunth at gmail.com Tue May 20 13:01:34 2008 From: mugunth at gmail.com (Muguntharaj Subramanian) Date: Tue, 20 May 2008 04:01:34 -0700 Subject: [python-win32] Is it possible to send Unicode characters using SendKeys ? Message-ID: <8dd9fd0805200401p211fa9d4xbd930b182075600b@mail.gmail.com> Hi All, I have started exploring Sendkeys: http://www.rutherfurd.net/python/sendkeys/ for one of my applications. I find sendkey works well for sending ascii characters to the active applications. I am not able to find any documentation on how to send unicode characters using sendkey. Is it possible for us to use sendkeys to send unicode characters to applications? If yes please let me know how to do it. Regards Mugunth -- http://mugunth.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From siddhartha.veedaluru at gmail.com Tue May 20 13:03:12 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Tue, 20 May 2008 16:33:12 +0530 Subject: [python-win32] import COM modules and access the methods and properties Message-ID: <424b71ec0805200403u3d81f570x21308a8a4f53701f@mail.gmail.com> Hi, we are using HP Quality Center Test Director. It provides Open Test Architecture API so that we can you use this API with other tools such as VB,C++ to connect,perform operation etc with TestDirector.The Open Test Architecture API is a COM library. Using PythonWin COM Browser i can see its Objects.It seems we can use win32com/pythoncom to access the objects and interact with TD. But i'm new to COM,So help needed in importing modules and getting the objects to use with in my scripts. If i'm incomplete anywhere and require more information please specify. Thanks a million, Siddhartha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Tue May 20 15:09:28 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 20 May 2008 14:09:28 +0100 Subject: [python-win32] Is it possible to send Unicode characters using SendKeys ? In-Reply-To: <8dd9fd0805200401p211fa9d4xbd930b182075600b@mail.gmail.com> References: <8dd9fd0805200401p211fa9d4xbd930b182075600b@mail.gmail.com> Message-ID: <4832CD88.7090403@timgolden.me.uk> Muguntharaj Subramanian wrote: > Hi All, > I have started exploring Sendkeys: > http://www.rutherfurd.net/python/sendkeys/ for one of my applications. > I find sendkey works well for sending ascii characters to the active > applications. I am not able to find any documentation on how to send unicode > characters using sendkey. > Is it possible for us to use sendkeys to send unicode characters to > applications? If yes please let me know how to do it. >From a quick glance, the source in _sendkeys.c is using the MapVirtualKeyA API call, which is non-Unicode. Frankly, I've never used this package and I'm unaware of any subtleties, but I'd guess it won't handle Unicode. Have you contacted the authors? TJG From adam at volition-inc.com Tue May 20 15:55:24 2008 From: adam at volition-inc.com (Adam Pletcher) Date: Tue, 20 May 2008 08:55:24 -0500 Subject: [python-win32] maya and python References: <81bfef2e0805190724v76d3df2y775b496f2e3119e4@mail.gmail.com> Message-ID: <893A44FF792E904A97B7515CE3419146032057B2@volimxs01.thqinc.com> A good source of Maya + Python information is CGTalk's Maya Programming forum: http://forums.cgsociety.org/forumdisplay.php?f=89 ? In particular, there's this lengthy thread titled "wxPython and Maya 8.5". http://forums.cgsociety.org/showthread.php?f=89&t=453070 ? I imagine it's all still applicable to Maya 2008. ? - Adam ________________________________________ From: python-win32-bounces at python.org on behalf of kNish Sent: Mon 5/19/2008 9:24 AM To: python-win32 at python.org Subject: [python-win32] maya and python Hi, ?????????? How good is python 3rd party plugin like wxpython compatible with maya 2008 that is running on windows 64. Do you say it is a good idea to run scripts on it and expect a smooth function flow. BRgds, kNish From timr at probo.com Tue May 20 18:55:14 2008 From: timr at probo.com (Tim Roberts) Date: Tue, 20 May 2008 09:55:14 -0700 Subject: [python-win32] using the wave module for reading wave files In-Reply-To: <8249c4ac0805191525p386726fct25b6bcd988664047@mail.gmail.com> References: <8249c4ac0805191525p386726fct25b6bcd988664047@mail.gmail.com> Message-ID: <48330272.60003@probo.com> Tony Cappellini wrote: > > In the wave module, is the term "frame" synonymous with sample? > That is, does the method wave.readframes(1) read a sample that is > getsampwidth() bits wide, where each sample was sampled at the > frequency found at wave.getframerate() ? The nice thing about Python is that you can go look in the source. wave.py is in the standard library. Each "frame" is sample width X number of channels. If you have a 44100-S-16 audio stream, each frame is 4 bytes (stereo x 16 bits per sample). -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From siddhartha.veedaluru at gmail.com Tue May 20 19:58:32 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Tue, 20 May 2008 23:28:32 +0530 Subject: [python-win32] Fwd: import COM modules and access the methods and properties In-Reply-To: <424b71ec0805200403u3d81f570x21308a8a4f53701f@mail.gmail.com> References: <424b71ec0805200403u3d81f570x21308a8a4f53701f@mail.gmail.com> Message-ID: <424b71ec0805201058n2cb5e602hcb3c1946165afafe@mail.gmail.com> Hi, we are using HP Quality Center Test Director. It provides Open Test Architecture API so that we can you use this API with other tools such as VB,C++ to connect,perform operation etc with TestDirector.The Open Test Architecture API is a COM library. Using PythonWin COM Browser i can see its Objects.It seems we can use win32com/pythoncom to access the objects and interact with TD. But i'm new to COM,So help needed in importing modules and getting the objects to use with in my scripts. If i'm incomplete anywhere and require more information please specify. Thanks a million, Siddhartha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Wed May 21 10:12:08 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 21 May 2008 09:12:08 +0100 Subject: [python-win32] Fwd: import COM modules and access the methods and properties In-Reply-To: <424b71ec0805201058n2cb5e602hcb3c1946165afafe@mail.gmail.com> References: <424b71ec0805200403u3d81f570x21308a8a4f53701f@mail.gmail.com> <424b71ec0805201058n2cb5e602hcb3c1946165afafe@mail.gmail.com> Message-ID: <4833D958.90102@timgolden.me.uk> siddhartha veedaluru wrote: > we are using HP Quality Center Test Director. > It provides Open Test Architecture API so that we can you use this API with > other tools such as VB,C++ to connect,perform operation etc with > TestDirector.The Open Test Architecture API is a COM library. > > Using PythonWin COM Browser i can see its Objects.It seems we can use > win32com/pythoncom to access the objects and interact with TD. > > But i'm new to COM,So help needed in importing modules and getting the > objects to use with in my scripts. > > If i'm incomplete anywhere and require more information please specify. I can't remember if someone's already suggested this to you, but if not, then the best thing is to get hold of "Python Programming on Win32" from O'Reilly [1], either by buying it or through Safari. By good fortune, one of the sample chapters [2] is exactly on COM programming. Have a look and try some things out. TJG [1] http://www.oreilly.com/catalog/9781565926219/ [2] http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html From Ron.Henderson at dreamworks.com Thu May 22 05:03:19 2008 From: Ron.Henderson at dreamworks.com (Ron Henderson) Date: Wed, 21 May 2008 20:03:19 -0700 Subject: [python-win32] MSProject and export maps Message-ID: <4834E277.8010507@anim.dreamworks.com> Does anybody know how to avoid the "Export Wizard" when saving a file with MSProject? The FileSaveAs method seems to ignore the Map keyword. My code looks essentially like this: mp = Dispatch("MSProject.Application") mp.FileOpen(mppFile) mp.FileSaveAs(csvFile, Format=3, Map="My Export Map") mp.FileClose(Save=0) mp.FileQuit() This gets the correct data into the file, but MSProject pops up the "Export Wizard" and forces me to select the map manually in order to complete the FileSaveAs() operation. Other people seem have encountered the same problem, but I haven't seen a solution anywhere. The only workaround I've found is to record this action as a macro and execute the macro: mp = Dispatch("MSProject.Application") mp.FileOpen(mppFile) mp.Run("My Export Macro") mp.FileClose(Save=0) mp.FileQuit() From mail at timgolden.me.uk Thu May 22 11:33:38 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 22 May 2008 10:33:38 +0100 Subject: [python-win32] MSProject and export maps In-Reply-To: <4834E277.8010507@anim.dreamworks.com> References: <4834E277.8010507@anim.dreamworks.com> Message-ID: <48353DF2.2020505@timgolden.me.uk> Ron Henderson wrote: > Does anybody know how to avoid the "Export Wizard" when saving a file > with MSProject? The FileSaveAs method seems to ignore the Map keyword. Hopefully someone here will have a clue (altho' it won't be me :) ) But have you tried posting to an MS-specific group? It doesn't look to be a Python issue specifically? TJG From mail at timgolden.me.uk Thu May 22 18:21:47 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 22 May 2008 17:21:47 +0100 Subject: [python-win32] Request for comments Message-ID: <48359D9B.7040109@timgolden.me.uk> I have a request of the python-win32 community. Have a look at: http://timgolden.me.uk/python-on-windows/ In particular, click through to the section on the Registry (which is the only section which has anything useful in it!) and then tell me what you think. About anything. The contents, the style, the colours, the colors, the depth of examples, the notes. What should be there? What shouldn't? How much overlap there should be with other sources of documentation? How much should just be links across? Should I reproduce the pywin32 docs verbatim. (Difficult: I've got a branch which is trying. Very trying). Anything. Points to bear in mind: * This is very alpha * I'm using Sphinx but I've done very little with its capabilities * The examples I've put together work: you can drop them straight onto an interpreter window and run them. But is that a desirable goal. * My intention is that this be a community effort. (The source is actually hosted at Google Code). * This URL (probably) won't be its final resting place. In particular, it will be very clear as you read that I'm 100% sure where I'm going with it yet. But at the very least I want lots of examples which, even in passing, semi-document the kind of stuff which people ask about on python-win32 and python-list. Enough babble from me. Have a look. TJG From python at bdurham.com Thu May 22 18:59:11 2008 From: python at bdurham.com (python at bdurham.com) Date: Thu, 22 May 2008 12:59:11 -0400 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: <1211475551.12362.1254583373@webmail.messagingengine.com> Tim, 1. Layout (color, font, margins) looks great. 2. Home page: a. Include a next (page) link in header/footer? b. Include an about page with brief note about site's reStructuredText markup and Sphinx. Include a brief description of the Show Source links (cool!). 3. Getting Started page: a. Include links to pywin32 and comtypes downloads. 4. When I randomly walked the site, the previous/next links in the headers and footers don't seem to link to what I would consider the previous/next logical pages. Looking forward to reading your site. Regards, Malcolm From fuzzyman at voidspace.org.uk Thu May 22 18:39:26 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 22 May 2008 17:39:26 +0100 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: <4835A1BE.3090405@voidspace.org.uk> Hello Tim, That looks really good! Michael Tim Golden wrote: > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > > In particular, click through to the section on the Registry (which is > the only section which has anything useful in it!) > and then tell me what you think. About anything. The contents, > the style, the colours, the colors, the depth of examples, the > notes. What should be there? What shouldn't? How much overlap > there should be with other sources of documentation? How much > should just be links across? Should I reproduce the pywin32 docs > verbatim. (Difficult: I've got a branch which is trying. Very trying). > Anything. > > Points to bear in mind: > > * This is very alpha > * I'm using Sphinx but I've done very little with its capabilities > * The examples I've put together work: you can drop them straight > onto an interpreter window and run them. But is that a desirable goal. > * My intention is that this be a community effort. (The source is > actually > hosted at Google Code). > * This URL (probably) won't be its final resting place. > > In particular, it will be very clear as you read that I'm 100% sure > where I'm going with it yet. But at the very least I want lots of > examples which, even in passing, semi-document the kind of stuff which > people ask about > on python-win32 and python-list. > > Enough babble from me. Have a look. > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From Ron.Henderson at dreamworks.com Thu May 22 19:20:40 2008 From: Ron.Henderson at dreamworks.com (Ron Henderson) Date: Thu, 22 May 2008 10:20:40 -0700 Subject: [python-win32] MSProject and export maps In-Reply-To: <48353DF2.2020505@timgolden.me.uk> References: <4834E277.8010507@anim.dreamworks.com> <48353DF2.2020505@timgolden.me.uk> Message-ID: <4835AB68.4090209@dreamworks.com> My guess is that it *is* a Python problem somewhere in the win32com bindings, based on the fact that executing a macro seems to do the right thing but going directly through the com API from Python does not. The macro executes essentially the same functionality: Sub my_export() FileSaveAs name:="...", formatId:="MSProject.CSV", map:="My Map" End Sub Tim Golden wrote: > Hopefully someone here will have a clue (altho' it won't be me :) ) > But have you tried posting to an MS-specific group? It doesn't > look to be a Python issue specifically? From mail at timgolden.me.uk Thu May 22 19:42:31 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 22 May 2008 18:42:31 +0100 Subject: [python-win32] MSProject and export maps In-Reply-To: <4835AB68.4090209@dreamworks.com> References: <4834E277.8010507@anim.dreamworks.com> <48353DF2.2020505@timgolden.me.uk> <4835AB68.4090209@dreamworks.com> Message-ID: <4835B087.10406@timgolden.me.uk> Ron Henderson wrote: > My guess is that it *is* a Python problem somewhere in the win32com > bindings, based on the fact that executing a macro seems to do the right > thing but going directly through the com API from Python does not. Ah. You cunningly missed that out from your previous description ;) (All right; now I read it more carefully I see that it's there really. Oh well). > The macro executes essentially the same functionality: > > Sub my_export() > FileSaveAs name:="...", formatId:="MSProject.CSV", map:="My Map" > End Sub If I get a chance tomorrow I'll have a look on a machine with MS Project installed. Not near one here. TJG From fuzzyman at voidspace.org.uk Thu May 22 20:37:14 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 22 May 2008 19:37:14 +0100 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: <4835BD5A.9040205@voidspace.org.uk> Hello Tim, I posted the link on Twitter, and got a response back asking if there would be documentation on deployment - py2exe, PyInstaller etc. Whilst I doubt you can be expected to be a fount of *all* knowledge, perhaps links or summaries of these topics could be good. Michael Foord http://www.ironpythoninaction.com/ Tim Golden wrote: > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > > In particular, click through to the section on the Registry (which is > the only section which has anything useful in it!) > and then tell me what you think. About anything. The contents, > the style, the colours, the colors, the depth of examples, the > notes. What should be there? What shouldn't? How much overlap > there should be with other sources of documentation? How much > should just be links across? Should I reproduce the pywin32 docs > verbatim. (Difficult: I've got a branch which is trying. Very trying). > Anything. > > Points to bear in mind: > > * This is very alpha > * I'm using Sphinx but I've done very little with its capabilities > * The examples I've put together work: you can drop them straight > onto an interpreter window and run them. But is that a desirable goal. > * My intention is that this be a community effort. (The source is > actually > hosted at Google Code). > * This URL (probably) won't be its final resting place. > > In particular, it will be very clear as you read that I'm 100% sure > where I'm going with it yet. But at the very least I want lots of > examples which, even in passing, semi-document the kind of stuff which > people ask about > on python-win32 and python-list. > > Enough babble from me. Have a look. > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From mail at timgolden.me.uk Thu May 22 20:50:06 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 22 May 2008 19:50:06 +0100 Subject: [python-win32] Request for comments In-Reply-To: <4835BD5A.9040205@voidspace.org.uk> References: <48359D9B.7040109@timgolden.me.uk> <4835BD5A.9040205@voidspace.org.uk> Message-ID: <4835C05E.4030302@timgolden.me.uk> Michael Foord wrote: > Hello Tim, > > I posted the link on Twitter, and got a response back asking if there > would be documentation on deployment - py2exe, PyInstaller etc. > > Whilst I doubt you can be expected to be a fount of *all* knowledge, > perhaps links or summaries of these topics could be good. I think the main point here is that, while I expect to provide impetus and a fair bit of content, I *want* other people to chip in. At the least, as you've done here, with a "What about...?" but even better with content or, at least, links. Ideally there should be some value added above and beyond whatever someone can find out by typing "Python deployment windows" into Google. I'm adding stub pages with "ideas" as ideas like this come in and/or they occur to me. When I've got just a little more substance to it, I'll publish the Subversion repos. (which is on Google code) so people can patch against it, or even join the project. (He says, optimistically!) TJG From python at bdurham.com Thu May 22 21:46:07 2008 From: python at bdurham.com (python at bdurham.com) Date: Thu, 22 May 2008 15:46:07 -0400 Subject: [python-win32] Request for comments In-Reply-To: <4835C05E.4030302@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4835BD5A.9040205@voidspace.org.uk> <4835C05E.4030302@timgolden.me.uk> Message-ID: <1211485567.13655.1254609905@webmail.messagingengine.com> Tim, Some ideas for high-level sections: - Creating COM components - Interfacing to COM components - Creating NT services - Sending/receiving Windows messages - Interfacing to the clipboard - Interfacing to DDE - Monitoring processes (Task Manager stats on a process) - Reading/writing NT Event logs The News2News site may give you (and your audience) some ideas as well. >From this site's about page: QUOTE: Welcome to the FoxPro WinAPI Online Reference, your source of information on how to use Windows API functions in Visual FoxPro. Several hundred proven FoxPro code samples make the core of this reference. Use "copy and paste" and try them now. Sometimes a line of code is worth a dozen of pages and hours of online searching. http://news2news.com/vfp/index.php Malcolm From rwupole at msn.com Fri May 23 02:20:01 2008 From: rwupole at msn.com (Roger Upole) Date: Thu, 22 May 2008 20:20:01 -0400 Subject: [python-win32] MSProject and export maps Message-ID: Ron Henderson wrote: > My guess is that it *is* a Python problem somewhere in the win32com > bindings, based on the fact that executing a macro seems to do the right > thing but going directly through the com API from Python does not. > > The macro executes essentially the same functionality: > > Sub my_export() > FileSaveAs name:="...", formatId:="MSProject.CSV", map:="My Map" > End Sub > Have you tried using exactly the same parameters in your Python code? It's using Format=3 instead of FormatId. If that doesn't get it, it may have something to do with the default values for arguments that you're not passing. Roger From mail at timgolden.me.uk Fri May 23 10:44:37 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 23 May 2008 09:44:37 +0100 Subject: [python-win32] MSProject and export maps In-Reply-To: References: Message-ID: <483683F5.5030901@timgolden.me.uk> Roger Upole wrote: > Ron Henderson wrote: >> My guess is that it *is* a Python problem somewhere in the win32com >> bindings, based on the fact that executing a macro seems to do the >> right thing but going directly through the com API from Python does not. >> >> The macro executes essentially the same functionality: >> >> Sub my_export() >> FileSaveAs name:="...", formatId:="MSProject.CSV", map:="My Map" >> End Sub >> > > Have you tried using exactly the same parameters in your Python code? > It's using Format=3 instead of FormatId. > > If that doesn't get it, it may have something to do with the default > values for arguments that you're not passing. This works for me (I basically recorded a Macro and reproduced it): import win32com.client project = win32com.client.Dispatch ("MSProject.Application") project.FileOpen ("c:/temp/p1.mpp") project.FileSaveAs (Name="c:/temp/p2.csv", FormatID="MSProject.CSV", Map="p1") project.FileClose (Save=0) project.FileQuit () TJG From graemeglass at gmail.com Fri May 23 10:48:46 2008 From: graemeglass at gmail.com (Graeme Glass) Date: Fri, 23 May 2008 10:48:46 +0200 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: On Thu, May 22, 2008 at 6:21 PM, Tim Golden wrote: > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > > In particular, click through to the section on the Registry (which is the > only section which has anything useful in it!) > and then tell me what you think. About anything. The contents, > the style, the colours, the colors, the depth of examples, the > notes. What should be there? What shouldn't? How much overlap > there should be with other sources of documentation? How much > should just be links across? Should I reproduce the pywin32 docs > verbatim. (Difficult: I've got a branch which is trying. Very trying). > Anything. > > Points to bear in mind: > > * This is very alpha > * I'm using Sphinx but I've done very little with its capabilities > * The examples I've put together work: you can drop them straight onto an > interpreter window and run them. But is that a desirable goal. > * My intention is that this be a community effort. (The source is actually > hosted at Google Code). > * This URL (probably) won't be its final resting place. > > In particular, it will be very clear as you read that I'm 100% sure where > I'm going with it yet. But at the very least I want lots of examples which, > even in passing, semi-document the kind of stuff which people ask about > on python-win32 and python-list. > > Enough babble from me. Have a look. > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > Thanks for this Tim, I think the site is layed out nicely and easy to navigate, and will be a great edition for anyone searching for resources on programming in the win32 domain. Kind Regards, Graeme -------------- next part -------------- An HTML attachment was scrubbed... URL: From mc at mclaveau.com Fri May 23 11:23:33 2008 From: mc at mclaveau.com (Michel Claveau) Date: Fri, 23 May 2008 11:23:33 +0200 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: Hi! For IPC.Mailslot, if you need, you can look my little example-code (below). Tested for compatibility with Vista.waitfor.exe ; and tested XP <=> Vista via LAN (sorry for my bad english) @-salutations -- Michel Claveau # -*- coding: cp1252 -*- def mailslotserver(duree=999999, systemname='.', mailslotname="waitfor.exe", signal="SIGNAL"): """Attend (surveille) un mailslot Exemple : flag,data=mailslot.mailslotserver( duree=600, systemname=".", mailslotname="waitfor.exe", signal="SIGNAL" ) """ import ctypes, win32file myslot = '\\\\'+systemname+'\\mailslot\\'+mailslotname+'\\'+signal nbs=ctypes.c_long(duree*1000) hReceive = ctypes.windll.kernel32.CreateMailslotA(myslot, 0, nbs, 0) if hReceive == -1: data="Access error to Mailslot" return False,data buffer = win32file.AllocateReadBuffer(400) try: rc, data = win32file.ReadFile(hReceive, buffer) except: data="out of time" return False,data return True,data def mailslotclient( systemname='.', mailslotname="waitfor.exe", signal="SIGNAL", data='ABC'): """Envoie un message par mailslot Exemples : mailslotclient( systemname="*", mailslotname="waitfor.exe", signal="SIGNAL", data="TESTCLIENT et c'est no?l ?" ) mailslotclient( systemname="ServeurCPQ", mailslotname="waitfor.exe", signal="SYNCHRO", data="Termin?" ) """ import win32file,win32con #print 23,'\\\\'+systemname+'\\mailslot\\'+mailslotname+'\\'+signal mailslot = win32file.CreateFile('\\\\'+systemname+'\\mailslot\\'+mailslotname+'\\'+signal, win32file.GENERIC_WRITE, 0, None, win32con.CREATE_NEW, 0, None) #print 24,"mailslot",mailslot import time time.sleep(0.1) win32file.WriteFile(mailslot, data) mailslot.Close() if __name__ == '__main__': import sys if len(sys.argv)>1: if sys.argv[1].upper()[:4]=="SERV": flag,data=mailslotserver(duree=9, systemname=".", mailslotname="waitfor.exe", signal="SIGNAL") print "R?sultat : ",flag," (",data,") " else: mailslotclient(systemname=".", mailslotname="waitfor.exe", signal="SIGNAL", data="TESTCLIENT") From tejovathi.p at gmail.com Fri May 23 14:18:28 2008 From: tejovathi.p at gmail.com (Tejovathi P) Date: Fri, 23 May 2008 17:48:28 +0530 Subject: [python-win32] Py2exe and win32com.shell Message-ID: Hi all... I created an exe for my application. While generating the exe, py2exe reports that win32com.shell module is not found and continues generating exe. When I try to run the exe, I get an import error that "No module named shell"....... I opened pythonwin and tried importing wincom.shell. Its working fine.....!!!!! Then where am I doing wrong.... My setup file looks like: #Start here from distutils.core import setup import py2exe setup(options = {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1, "bundle_files": 1}}, zipfile = None, console = ["Sample.py"], name = 'test') #End here Thanks.. Tejovathi -------------- next part -------------- An HTML attachment was scrubbed... URL: From njp at njp.us Fri May 23 15:06:59 2008 From: njp at njp.us (Norm Petterson) Date: Fri, 23 May 2008 09:06:59 -0400 Subject: [python-win32] Py2exe and win32com.shell In-Reply-To: References: Message-ID: <9670a730805230606l8edffa8jca6984ce327666fd@mail.gmail.com> On Fri, May 23, 2008 at 8:18 AM, Tejovathi P wrote: > > > I opened pythonwin and tried importing wincom.shell. Its working > fine.....!!!!! Then where am I doing wrong.... > > Hello Tejovathi, Googling py2exe win32com gave this reference among the first few: http://www.wiredfool.com/2006/11/18/python-and-com-components/ containing this clue: *The final wrinkle in this exercise is packaging using py2exe. Win32com needs to be added as a package in the setup.py, *HTH, Norm -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ron.Henderson at dreamworks.com Fri May 23 15:11:04 2008 From: Ron.Henderson at dreamworks.com (Ron Henderson) Date: Fri, 23 May 2008 06:11:04 -0700 (PDT) Subject: [python-win32] MSProject and export maps In-Reply-To: <483683F5.5030901@timgolden.me.uk> References: <483683F5.5030901@timgolden.me.uk> Message-ID: Can you confirm that the output is really a CVS (text) file? When I tried this the file that was written was still a binary .mpp file, i.e., the FormatID was ignored. > This works for me (I basically recorded a Macro and reproduced it): > > > import win32com.client > > project = win32com.client.Dispatch ("MSProject.Application") > project.FileOpen ("c:/temp/p1.mpp") > project.FileSaveAs (Name="c:/temp/p2.csv", FormatID="MSProject.CSV", > Map="p1") > project.FileClose (Save=0) > project.FileQuit () > > -- Ron Henderson DreamWorks Feature Animation, R&D 818 695-3199 From mail at timgolden.me.uk Fri May 23 15:14:43 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 23 May 2008 14:14:43 +0100 Subject: [python-win32] [Fwd: Re: MSProject and export maps] Message-ID: <4836C343.6070200@timgolden.me.uk> [Sorry, copying back to list] -------- Original Message -------- Subject: Re: [python-win32] MSProject and export maps Date: Fri, 23 May 2008 14:14:24 +0100 From: Tim Golden To: Ron Henderson References: <483683F5.5030901 at timgolden.me.uk> Ron Henderson wrote: > > Can you confirm that the output is really a CVS (text) file? When I > tried this the file that was written was still a binary .mpp file, i.e., > the FormatID was ignored. > >> This works for me (I basically recorded a Macro and reproduced it): >> >> >> import win32com.client >> >> project = win32com.client.Dispatch ("MSProject.Application") >> project.FileOpen ("c:/temp/p1.mpp") >> project.FileSaveAs (Name="c:/temp/p2.csv", FormatID="MSProject.CSV", >> Map="p1") >> project.FileClose (Save=0) >> project.FileQuit () >> >> I hadn't thought to check but, yes, it is: Name,Actual_Cost Do something,?0.00 Sorry not to be much more help; I'm not really an MS Project man myself. TJG From kevin.horn at gmail.com Fri May 23 19:41:12 2008 From: kevin.horn at gmail.com (Kevin Horn) Date: Fri, 23 May 2008 12:41:12 -0500 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: <562bcc10805231041x406cd754n9915bf054e6e5b04@mail.gmail.com> On Thu, May 22, 2008 at 11:21 AM, Tim Golden wrote: > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > Wow, Tim! Thanks for doing this. > In particular, click through to the section on the Registry (which is the > only section which has anything useful in it!) > and then tell me what you think. About anything. The contents, > the style, the colours, the colors, the depth of examples, the > notes. What should be there? What shouldn't? How much overlap > there should be with other sources of documentation? How much > should just be links across? Should I reproduce the pywin32 docs > verbatim. (Difficult: I've got a branch which is trying. Very trying). > Anything. > I'd like to see a little more prose to go with the examples, not just code. No too much, but enough that the reader can understand WHY a certain task i s done a certain way (and maybe why you would want to do it in the first place). I do like the fact that it's more of a "cookbook" than "stereo instructions". I think focusing on examples is right on target (and I love your other Py-win HOWTO pages BTW) Points to bear in mind: > > * This is very alpha > * I'm using Sphinx but I've done very little with its capabilities Sphinx can auto-create "Prev" and "Next" links, which might be useful. Kevin Horn -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Fri May 23 21:21:50 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 23 May 2008 20:21:50 +0100 Subject: [python-win32] Request for comments In-Reply-To: <562bcc10805231041x406cd754n9915bf054e6e5b04@mail.gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <562bcc10805231041x406cd754n9915bf054e6e5b04@mail.gmail.com> Message-ID: <4837194E.9070106@timgolden.me.uk> Kevin Horn wrote: > I'd like to see a little more prose to go with the examples, not just > code. > No too much, but enough that the reader can understand WHY a certain task i > s done a certain way (and maybe why you would want to do it in the first > place). Thanks for this input Kevin. Would you mind just posting up a paragraph or so of the kind of thing you mean, to give me an idea of the extent you feel would be useful? (If you're not au fait with Registry things, just pick some other Python-Win32 subject which you can write about: I just want to get a feel for what you had in mind). > Sphinx can auto-create "Prev" and "Next" links, which might be useful. Unless I misunderstand you, I think it's doing that, both across the top Navigation bar and along the left sidebar. Or did you mean something else? Thanks for taking the trouble to respond. It is appreciated. TJG From kevin.horn at gmail.com Fri May 23 21:25:48 2008 From: kevin.horn at gmail.com (Kevin Horn) Date: Fri, 23 May 2008 14:25:48 -0500 Subject: [python-win32] Request for comments In-Reply-To: <4837194E.9070106@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <562bcc10805231041x406cd754n9915bf054e6e5b04@mail.gmail.com> <4837194E.9070106@timgolden.me.uk> Message-ID: <562bcc10805231225l2f2ec1bsda95a426336692a@mail.gmail.com> On Fri, May 23, 2008 at 2:21 PM, Tim Golden wrote: > Kevin Horn wrote: > > Sphinx can auto-create "Prev" and "Next" links, which might be useful. >> > > Unless I misunderstand you, I think it's doing that, both across > the top Navigation bar and along the left sidebar. Or did you > mean something else? > Yeah, i had missed those initially, though I saw them after I sent my email. I guess I've been trained to expect them at teh bottom and/or top corners of the page. Thanks for taking the trouble to respond. It is appreciated. > > > TJG > No Problem. :) Kevin Horn -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgailer at gmail.com Sat May 24 00:30:04 2008 From: bgailer at gmail.com (bob gailer) Date: Fri, 23 May 2008 18:30:04 -0400 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: <4837456C.3000902@gmail.com> Tim Golden wrote: > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > > In particular, click through to the section on the Registry (which is > the only section which has anything useful in it!) > and then tell me what you think. Thanks for a much needed resource. Please omit the space before ( in code. I find that very distracting. Example: print result.Properties_ ("sValue").Value # current print result.Properties_("sValue").Value # preferred, and how most code I've seen looks. You said "you can drop them straight onto an interpreter window and run them" It would be quite nice if the Python for Windows Interactive Window also worked that way. Unfortunately copying your examples and pasting there does NOT work, and that has always been a pain in the butt for me. I'd also like to see a section on Python for Windows customization. I have looked at the (I forget the name of) file that defines keystrokes and other goodies, but have no clue as to how to modify or extend it. I asked years ago for guidance and got none. I would love to be able to hack Python for Window for a variety of reasons, so would also like some guidance rather than just "go read the source". -- Bob Gailer 919-636-4239 Chapel Hill, NC From timr at probo.com Sat May 24 01:14:57 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 23 May 2008 16:14:57 -0700 Subject: [python-win32] Request for comments In-Reply-To: <4837456C.3000902@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> Message-ID: <48374FF1.7090706@probo.com> bob gailer wrote: > > Please omit the space before ( in code. I find that very distracting. > Example: > > print result.Properties_ ("sValue").Value # current > > print result.Properties_("sValue").Value # preferred, and how most > code I've seen looks. Do you understand that this is strictly a personal preference? Some people like it, some people don't. You are certainly allowed to "prefer" one over the other, but it's a bit much to ask someone else to change their coding style to match yours, unless you are a paying client. ;) > You said "you can drop them straight onto an interpreter window and > run them" > > It would be quite nice if the Python for Windows Interactive Window > also worked that way. Unfortunately copying your examples and pasting > there does NOT work, and that has always been a pain in the butt for me. > > I'd also like to see a section on Python for Windows customization. I > have looked at the (I forget the name of) file that defines keystrokes > and other goodies, but have no clue as to how to modify or extend it. > I asked years ago for guidance and got none. > > I would love to be able to hack Python for Window for a variety of > reasons, so would also like some guidance rather than just "go read > the source". I think that each of these items is specifically talking about the Pythonwin editor here. Is that correct? I've never had problems cutting and pasting code, although I tend to use gvim and a command line instead. What issues do you see? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From rdahlstrom at directedge.com Sat May 24 04:13:45 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Fri, 23 May 2008 22:13:45 -0400 Subject: [python-win32] Request for comments References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> Message-ID: I'd add to that that I prefer the space, and I only use notepad++ for coding. Everything worked fine for me. My only suggestion was that the navigation was a bit inconsistent on the front page - I had to scroll down to see what the "contents" were - the "registry" section was hidden at first. I would have expected that to be in the upper left with the rest of the nav. -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Roberts Sent: Friday, May 23, 2008 7:15 PM To: Python-Win32 List Subject: Re: [python-win32] Request for comments bob gailer wrote: > > Please omit the space before ( in code. I find that very distracting. > Example: > > print result.Properties_ ("sValue").Value # current > > print result.Properties_("sValue").Value # preferred, and how most > code I've seen looks. Do you understand that this is strictly a personal preference? Some people like it, some people don't. You are certainly allowed to "prefer" one over the other, but it's a bit much to ask someone else to change their coding style to match yours, unless you are a paying client. ;) > You said "you can drop them straight onto an interpreter window and > run them" > > It would be quite nice if the Python for Windows Interactive Window > also worked that way. Unfortunately copying your examples and pasting > there does NOT work, and that has always been a pain in the butt for me. > > I'd also like to see a section on Python for Windows customization. I > have looked at the (I forget the name of) file that defines keystrokes > and other goodies, but have no clue as to how to modify or extend it. > I asked years ago for guidance and got none. > > I would love to be able to hack Python for Window for a variety of > reasons, so would also like some guidance rather than just "go read > the source". I think that each of these items is specifically talking about the Pythonwin editor here. Is that correct? I've never had problems cutting and pasting code, although I tend to use gvim and a command line instead. What issues do you see? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com From mail at timgolden.me.uk Sat May 24 10:22:06 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Sat, 24 May 2008 09:22:06 +0100 Subject: [python-win32] Request for comments In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> Message-ID: <4837D02E.8080007@timgolden.me.uk> Dahlstrom, Roger wrote: > My only suggestion was that the navigation was a bit > inconsistent on the front page - I had to scroll down > to see what the "contents" were - the "registry" > section was hidden at first. I would have expected > that to be in the upper left with the rest of the nav. I think it confused me, too. I'm still feeling my way with Sphinx. By default the TOC includes the page's own headings and not its children (or something like that). I need to ask on the sphinx-dev list about options to change that. TJG From mail at timgolden.me.uk Sat May 24 10:27:48 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Sat, 24 May 2008 09:27:48 +0100 Subject: [python-win32] Request for comments In-Reply-To: <4837456C.3000902@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> Message-ID: <4837D184.1050107@timgolden.me.uk> bob gailer wrote: > You said "you can drop them straight onto an interpreter window and run > them" > > It would be quite nice if the Python for Windows Interactive Window also > worked that way. Unfortunately copying your examples and pasting there > does NOT work, and that has always been a pain in the butt for me. I don't really use the PythonWin stuff myself so I haven't experienced that. I'll give it a go to see if there's something straightforward I can do to help there. As a consolation, all the examples are included .py files, so as soon as I've worked out how to get sphinx to include them in the doc generation, I'll add links to each so you can download to a file and run it how you like. > I'd also like to see a section on Python for Windows customization. I > have looked at the (I forget the name of) file that defines keystrokes > and other goodies, but have no clue as to how to modify or extend it. I > asked years ago for guidance and got none. > > I would love to be able to hack Python for Window for a variety of > reasons, so would also like some guidance rather than just "go read the > source". I'll add it to the todo list, altho' I've no real experience in this area myself so the content might have to come from elsewhere. Thanks for you input TJG From mail at timgolden.me.uk Sat May 24 10:28:19 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Sat, 24 May 2008 09:28:19 +0100 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <48374FF1.7090706@probo.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> Message-ID: <4837D1A3.8080107@timgolden.me.uk> [bob gailer] >> Please omit the space before ( in code. I find that very distracting. >> Example: >> >> print result.Properties_ ("sValue").Value # current >> >> print result.Properties_("sValue").Value # preferred, and how most >> code I've seen looks. [Tim Roberts] > Do you understand that this is strictly a personal preference? Some > people like it, some people don't. You are certainly allowed to > "prefer" one over the other, but it's a bit much to ask someone else to > change their coding style to match yours, unless you are a paying > client. ;) [Roger Dahlstrom] > I'd add to that that I prefer the space, and I only use notepad++ for > coding. Everything worked fine for me. On balance I'm inclined to stick to my spaces-before style, not least because I've been coding that way for well over 20 years and it's not that easy to change, even if I felt well-disposed. (Which I don't :) ) Apologies to Bob & anyone else who finds this style irksome. As you might imagine, I find the opposite style cluttered and hard to read. Likewise I imagine there are many who find my two-spaces indent style cluttered while I find even four and certainly any more to be grotesquely elongated. TJG From adam at volition-inc.com Sat May 24 14:36:50 2008 From: adam at volition-inc.com (Adam Pletcher) Date: Sat, 24 May 2008 07:36:50 -0500 Subject: [python-win32] COM illegal argument puzzler Message-ID: <893A44FF792E904A97B7515CE3419146F1ED2A@volimxs01.thqinc.com> A co-worker of mine is writing a tool to automate tasks in Photoshop, and found a win32 error we can't explain. And possibly a bug. The following script generates an error about how Select() can only take one-dimensional arrays: import win32com.client ps_app = win32com.client.Dispatch('Photoshop.Application') ps_app.Documents.Add(128, 128, 72) # select a 10x10 square in the upper left corner of the document sel_area = ((0, 0), (10, 0), (10, 10), (0, 10), (0, 0)) ps_app.ActiveDocument.Selection.Select(sel_area) The error: com_error: (-2147352567, 'Exception occurred.', (0, 'Adobe Photoshop', 'Illegal argument - argument 1\n- Only arrays with dimension 1 are supported', None, 0, -2147220262), None) File "c:\Python_Scripts\COM\Photoshop\selectionTest.py", line 7, in ps_app.ActiveDocument.Selection.Select(sel_area) File "C:\Python25\Lib\site-packages\win32com\gen_py\E891EE9A-D0AE-4CB4-8871-F92C0109F18Ex0x9x0.py", line 2606, in Select , Type, Feather, AntiAlias) The problem is that that method is documented as taking two dimensional arrays. Here's an exerpt from the Photoshop CS3 VBScript Ref doc: docH = appRef.ActiveDocument.Width / 2 docV = appRef.ActiveDocument.Height / 2 selRegion = Array( Array( topLeftH * docH, topLeftV * docV), _ Array( topLeftH * docH + docH, topLeftV * docV), _ Array( topLeftH * docH + docH, topLeftV * docV + docV), _ Array( topLeftH * docH, topLeftV * docV + docV), _ Array( topLeftH * docH, topLeftV * docV)) appRef.ActiveDocument.Selection.Select(selRegion) It makes sense that it has to take a sequence of two-element sequences, right? Oddly enough, if you run the above code using the comtypes extensions instead of win32com, it works perfectly. The first two lines then become: import comtypes.client ps_app = comtypes.client.CreateObject('Photoshop.Application') Any ideas why this throws an exception with win32com.client/Dispatch? Is this a bug? Thanks in advance. - Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdahlstrom at directedge.com Sat May 24 15:07:28 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Sat, 24 May 2008 09:07:28 -0400 Subject: [python-win32] Request for comments - the spaces issue References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com><48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> Message-ID: Ha - you'd hate my code then. I like a lot of spaces, makes it easier for me to keep the blocks seperated. -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden Sent: Saturday, May 24, 2008 4:28 AM Cc: Python-Win32 List Subject: Re: [python-win32] Request for comments - the spaces issue [bob gailer] >> Please omit the space before ( in code. I find that very distracting. >> Example: >> >> print result.Properties_ ("sValue").Value # current >> >> print result.Properties_("sValue").Value # preferred, and how most >> code I've seen looks. [Tim Roberts] > Do you understand that this is strictly a personal preference? Some > people like it, some people don't. You are certainly allowed to > "prefer" one over the other, but it's a bit much to ask someone else to > change their coding style to match yours, unless you are a paying > client. ;) [Roger Dahlstrom] > I'd add to that that I prefer the space, and I only use notepad++ for > coding. Everything worked fine for me. On balance I'm inclined to stick to my spaces-before style, not least because I've been coding that way for well over 20 years and it's not that easy to change, even if I felt well-disposed. (Which I don't :) ) Apologies to Bob & anyone else who finds this style irksome. As you might imagine, I find the opposite style cluttered and hard to read. Likewise I imagine there are many who find my two-spaces indent style cluttered while I find even four and certainly any more to be grotesquely elongated. TJG _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com From fuzzyman at voidspace.org.uk Sat May 24 15:26:10 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 24 May 2008 14:26:10 +0100 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com><48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> Message-ID: <48381772.7010000@voidspace.org.uk> Dahlstrom, Roger wrote: > Ha - you'd hate my code then. I like a lot of spaces, makes it easier for me to keep the blocks seperated. > I'm afraid that I abhor them. :-) Michael Foord http://www.ironpythoninaction.com/ > -----Original Message----- > From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden > Sent: Saturday, May 24, 2008 4:28 AM > Cc: Python-Win32 List > Subject: Re: [python-win32] Request for comments - the spaces issue > > [bob gailer] > >>> Please omit the space before ( in code. I find that very distracting. >>> Example: >>> >>> print result.Properties_ ("sValue").Value # current >>> >>> print result.Properties_("sValue").Value # preferred, and how most >>> code I've seen looks. >>> > > [Tim Roberts] > >> Do you understand that this is strictly a personal preference? Some >> people like it, some people don't. You are certainly allowed to >> "prefer" one over the other, but it's a bit much to ask someone else to >> change their coding style to match yours, unless you are a paying >> client. ;) >> > > [Roger Dahlstrom] > >> I'd add to that that I prefer the space, and I only use notepad++ for >> coding. Everything worked fine for me. >> > > On balance I'm inclined to stick to my spaces-before style, not > least because I've been coding that way for well over 20 years > and it's not that easy to change, even if I felt well-disposed. > (Which I don't :) ) > > Apologies to Bob & anyone else who finds this style irksome. As > you might imagine, I find the opposite style cluttered and hard > to read. Likewise I imagine there are many who find my two-spaces > indent style cluttered while I find even four and certainly any > more to be grotesquely elongated. > > TJG > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > DISCLAIMER: > This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and > may contain legally privileged and/or confidential information. If you are not the intended recipient > of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and > any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify > me and permanently delete the original and any copy of any e-mail and any printout thereof. > E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept > liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. > > NOTICE REGARDING PRIVACY AND CONFIDENTIALITY > Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. > > www.directedge.com > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From bgailer at gmail.com Sat May 24 16:37:10 2008 From: bgailer at gmail.com (bob gailer) Date: Sat, 24 May 2008 10:37:10 -0400 Subject: [python-win32] Request for comments In-Reply-To: <48374FF1.7090706@probo.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> Message-ID: <48382816.9030907@gmail.com> Tim Roberts wrote: > bob gailer wrote: >> >> Please omit the space before ( in code. I find that very distracting. >> Example: >> >> print result.Properties_ ("sValue").Value # current >> >> print result.Properties_("sValue").Value # preferred, and how most >> code I've seen looks. > > Do you understand that this is strictly a personal preference? Some > people like it, some people don't. You are certainly allowed to > "prefer" one over the other, but it's a bit much to ask someone else > to change their coding style to match yours, unless you are a paying > client. ;) I agree. Please consider that all of the code examples I've seen in the official Python documentation have no space before the (. Most newcomers to Python who goes thru the tutorial will learn that way of coding. I imagine it would be confusing for them to later see code with the space. Same true for Python cookbook. Follow Tim's link to Windows Registry Functions . MS's examples. Ditto. I'm aiming for consistency, and minimal confusion for many. > >> You said "you can drop them straight onto an interpreter window and >> run them" >> >> It would be quite nice if the Python for Windows Interactive Window >> also worked that way. Unfortunately copying your examples and pasting >> there does NOT work, and that has always been a pain in the butt for me. >> >> I'd also like to see a section on Python for Windows customization. I >> have looked at the (I forget the name of) file that defines >> keystrokes and other goodies, but have no clue as to how to modify or >> extend it. I asked years ago for guidance and got none. >> >> I would love to be able to hack Python for Window for a variety of >> reasons, so would also like some guidance rather than just "go read >> the source". > > I think that each of these items is specifically talking about the > Pythonwin editor here. Is that correct? True. > I've never had problems cutting and pasting code, although I tend to > use gvim and a command line instead. What issues do you see? > I copy 2 lines from an example: import win32api import win32con I paste them into the PythonWin Interactive window following the >>>. This is what I get: >>> import win32api import win32con| Where | is the blinking cursor. Neither line has been executed! There is no >>> Whereas pasting the same into the Python interpreter gives: >>> import win32api >>> import win32con >>> and both lines have executed. -- Bob Gailer 919-636-4239 Chapel Hill, NC From len200612 at revolutioncontrols.com Sat May 24 16:40:21 2008 From: len200612 at revolutioncontrols.com (Len Remmerswaal) Date: Sat, 24 May 2008 16:40:21 +0200 Subject: [python-win32] Request for comments In-Reply-To: References: Message-ID: <483828D5.5080803@revolutioncontrols.com> Tim, Could you add "up" buttons to the "previous|next" lines? I always use that type of button to regain my bearings in the multitude of pages. Also I miss a possibility to walk from the start page to all pages linearly, if I feel like browsing the lot. Especially on page one, it seems there are only two links, embedded in the text, to move on. Once I've read that first page, when revisiting the site, it would be nice to be able to move on immediately, without having to recall that the links are at the bottom in the text and scroll down to find them. Apart from that, please continue with providing this documentation. It contains a wealth of starting points for all of us that are not fully versed on MS APIs. Thanks, Len. > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > > In particular, click through to the section on the Registry (which is > the only section which has anything useful in it!) > and then tell me what you think. About anything. The contents, > the style, the colours, the colors, the depth of examples, the > notes. What should be there? What shouldn't? How much overlap > there should be with other sources of documentation? How much > should just be links across? Should I reproduce the pywin32 docs > verbatim. (Difficult: I've got a branch which is trying. Very trying). > Anything. > > From bgailer at gmail.com Sat May 24 16:40:13 2008 From: bgailer at gmail.com (bob gailer) Date: Sat, 24 May 2008 10:40:13 -0400 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <4837D1A3.8080107@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> Message-ID: <483828CD.7070006@gmail.com> Tim Golden wrote: > [snip] > Likewise I imagine there are many who find my two-spaces > indent style cluttered while I find even four and certainly any > more to be grotesquely elongated. I also prefer the 2 space indent! I also realize that when I wrote my previous reply I was not conscious that I was replying to the original post. So I referred to you as Tim. Sorry for that. -- Bob Gailer 919-636-4239 Chapel Hill, NC From fuzzyman at voidspace.org.uk Sat May 24 18:20:50 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 24 May 2008 17:20:50 +0100 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483828CD.7070006@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <483828CD.7070006@gmail.com> Message-ID: <48384062.10704@voidspace.org.uk> bob gailer wrote: > Tim Golden wrote: >> [snip] > >> Likewise I imagine there are many who find my two-spaces >> indent style cluttered while I find even four and certainly any >> more to be grotesquely elongated. > > I also prefer the 2 space indent! > > I also realize that when I wrote my previous reply I was not conscious > that I was replying to the original post. So I referred to you as Tim. > Sorry for that. > Four spaces is useful so that anything more than a few levels indentation really *is* too elongated - it is a good sign that you need to refactor your code. :-) Dropping to two space indent isn't a good way of solving the problem. ;-) FWIW Guido remarked a while ago that all of google's Python code is two space indented. Michael Foord http://www.ironpythoninaction.com/ From mail at timgolden.me.uk Sat May 24 21:05:17 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Sat, 24 May 2008 20:05:17 +0100 Subject: [python-win32] Request for comments In-Reply-To: <483828D5.5080803@revolutioncontrols.com> References: <483828D5.5080803@revolutioncontrols.com> Message-ID: <483866ED.6020007@timgolden.me.uk> Len Remmerswaal wrote: > Tim, > Could you add "up" buttons to the "previous|next" lines? I always use > that type of button to regain my bearings in the multitude of pages. > Also I miss a possibility to walk from the start page to all pages > linearly, if I feel like browsing the lot. > Especially on page one, it seems there are only two links, embedded in > the text, to move on. Once I've read that first page, when revisiting > the site, it would be nice to be able to move on immediately, without > having to recall that the links are at the bottom in the text and scroll > down to find them. Good points there, Len. I'm always very keen to make the very best use of navigation possibilities. In this case I'm using Sphinx (rather than rolling my own) so I'll have to delve into the docs & templates there to try to do the right thing. Meanwhile I'm playing about quite a bit with the first page since it's the most important one for most people. Not sure I've got the right balance yet, though. TJG From mail at timgolden.me.uk Sat May 24 21:12:04 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Sat, 24 May 2008 20:12:04 +0100 Subject: [python-win32] Request for comments In-Reply-To: <48382816.9030907@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <48382816.9030907@gmail.com> Message-ID: <48386884.2050101@timgolden.me.uk> bob gailer wrote: > Tim Roberts wrote: >> bob gailer wrote: >>> >>> Please omit the space before ( in code. I find that very distracting. >>> Example: >>> >>> print result.Properties_ ("sValue").Value # current >>> >>> print result.Properties_("sValue").Value # preferred, and how most >>> code I've seen looks. >> >> Do you understand that this is strictly a personal preference? Some >> people like it, some people don't. You are certainly allowed to >> "prefer" one over the other, but it's a bit much to ask someone else >> to change their coding style to match yours, unless you are a paying >> client. ;) > > I agree. Please consider that all of the code examples I've seen in the > official Python documentation have no space before the (. Most newcomers > to Python who goes thru the tutorial will learn that way of coding. I > imagine it would be confusing for them to later see code with the space. > Same true for Python cookbook. Follow Tim's link to Windows Registry > Functions > . MS's > examples. Ditto. I'm aiming for consistency, and minimal confusion for > many. It's a fair point. For now (basically because I can do it faster) I'll go with my spaces-before convention. When I get a chance to breathe we can revisit this and other other coding style issues. All the example code is in individual Python files so a global search-and-replace should be possible if it becomes desirable. [... snip description of problems with the PythonWin interpreter ...] Yes, I tried that to see what you meant. I'm not sure there's much I'm going to be able to do about that, unless someone jumps in with a solution. My main point about the examples is that they're self-contained. (ie you don't need to prearrange any data or install any modules unless indicated). The ability to drop them into a Python interpreter window is a nice-to-have which I make use of whenever I'm posting code. If anyone can suggest anything here, even in the form of a hint in the docs, please let me know. Thanks for your continued interest, Bob. TJG From rwupole at msn.com Sun May 25 01:02:36 2008 From: rwupole at msn.com (Roger Upole) Date: Sat, 24 May 2008 19:02:36 -0400 Subject: [python-win32] COM illegal argument puzzler Message-ID: Adam Pletcher wrote: > A co-worker of mine is writing a tool to automate tasks in Photoshop, and > found a win32 error we can't explain. And possibly a bug. > > The following script generates an error about how Select() can only take > one-dimensional arrays: > > import win32com.client > ps_app = win32com.client.Dispatch('Photoshop.Application') > ps_app.Documents.Add(128, 128, 72) > > # select a 10x10 square in the upper left corner of the document > sel_area = ((0, 0), (10, 0), (10, 10), (0, 10), (0, 0)) > ps_app.ActiveDocument.Selection.Select(sel_area) > > The error: > > com_error: (-2147352567, 'Exception occurred.', (0, 'Adobe Photoshop', > 'Illegal argument - argument 1\n- Only arrays with dimension 1 are > supported', None, 0, -2147220262), None) > File "c:\Python_Scripts\COM\Photoshop\selectionTest.py", line 7, in > > ps_app.ActiveDocument.Selection.Select(sel_area) > File > "C:\Python25\Lib\site-packages\win32com\gen_py\E891EE9A-D0AE-4CB4-8871-F92C0109F18Ex0x9x0.py", > line 2606, in Select > , Type, Feather, AntiAlias) > > The problem is that that method is documented as taking two dimensional > arrays. Here's an exerpt from the Photoshop CS3 VBScript Ref doc: > > docH = appRef.ActiveDocument.Width / 2 > docV = appRef.ActiveDocument.Height / 2 > selRegion = Array( Array( topLeftH * docH, topLeftV * docV), _ > Array( topLeftH * docH + docH, topLeftV * docV), _ > Array( topLeftH * docH + docH, topLeftV * docV + docV), _ > Array( topLeftH * docH, topLeftV * docV + docV), _ > Array( topLeftH * docH, topLeftV * docV)) > appRef.ActiveDocument.Selection.Select(selRegion) > > It makes sense that it has to take a sequence of two-element sequences, > right? Oddly enough, if you run the above code using the comtypes > extensions instead of win32com, it works perfectly. The > first two lines > then become: > > import comtypes.client > ps_app = comtypes.client.CreateObject('Photoshop.Application') > > Any ideas why this throws an exception with win32com.client/Dispatch? Is > this a bug? > > Thanks in advance. > > - Adam I think the difference here is whether to interpret the tuple as a 2-dim array or a 1 dim array of 1 dim arrays. Comtypes apparently does it in the way that this particular API expects, although other applications may have different requirements. There's a patch (#1195096) for giving finer grained control over how arrays are passed to and from COM calls. Roger From mhammond at skippinet.com.au Sun May 25 09:29:14 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sun, 25 May 2008 17:29:14 +1000 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <4837D1A3.8080107@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> Message-ID: <00ce01c8be39$0b5f08d0$221d1a70$@com.au> In general, I *try* and stick to the Python Style Guide (http://www.python.org/dev/peps/pep-0008/), particularly for new code. This makes it easier to contribute code to Python itself, and a number of other projects (eg bzr) have a policy that requires contributed code conform (and indeed, they make use of tools to check this). While I don't agree with everything in the style guide, IMO more is gained by me following it than by indulging myself in personal taste issues that really don't matter. One of my favourite things about pep8 is that the first real heading is "A Foolish Consistency is the Hobgoblin of Little Minds", so I think its tone is quite reasonable. Unfortunately for this discussion, the space before the parens can be found under the "Pet Peeves" section :) Cheers, Mark From nytrokiss at gmail.com Sun May 25 22:55:50 2008 From: nytrokiss at gmail.com (James Matthews) Date: Sun, 25 May 2008 22:55:50 +0200 Subject: [python-win32] Request for comments In-Reply-To: <48386884.2050101@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <48382816.9030907@gmail.com> <48386884.2050101@timgolden.me.uk> Message-ID: <8a6b8e350805251355q4594b6ebm9e18690f4362d841@mail.gmail.com> Great site. I like the idea and am going to start posting some code.. On Sat, May 24, 2008 at 9:12 PM, Tim Golden wrote: > bob gailer wrote: > >> Tim Roberts wrote: >> >>> bob gailer wrote: >>> >>>> >>>> Please omit the space before ( in code. I find that very distracting. >>>> Example: >>>> >>>> print result.Properties_ ("sValue").Value # current >>>> >>>> print result.Properties_("sValue").Value # preferred, and how most code >>>> I've seen looks. >>>> >>> >>> Do you understand that this is strictly a personal preference? Some >>> people like it, some people don't. You are certainly allowed to "prefer" >>> one over the other, but it's a bit much to ask someone else to change their >>> coding style to match yours, unless you are a paying client. ;) >>> >> >> I agree. Please consider that all of the code examples I've seen in the >> official Python documentation have no space before the (. Most newcomers to >> Python who goes thru the tutorial will learn that way of coding. I imagine >> it would be confusing for them to later see code with the space. Same true >> for Python cookbook. Follow Tim's link to Windows Registry Functions < >> http://msdn.microsoft.com/en-us/library/ms724875%28VS.85%29.aspx>. MS's >> examples. Ditto. I'm aiming for consistency, and minimal confusion for many. >> > > It's a fair point. For now (basically because I can do it faster) > I'll go with my spaces-before convention. When I get a chance to > breathe we can revisit this and other other coding style issues. > All the example code is in individual Python files so a global > search-and-replace should be possible if it becomes desirable. > > [... snip description of problems with the PythonWin interpreter ...] > > Yes, I tried that to see what you meant. I'm not sure there's > much I'm going to be able to do about that, unless someone > jumps in with a solution. My main point about the examples is > that they're self-contained. (ie you don't need to prearrange > any data or install any modules unless indicated). The ability > to drop them into a Python interpreter window is a nice-to-have > which I make use of whenever I'm posting code. > > If anyone can suggest anything here, even in the form of a hint > in the docs, please let me know. > > Thanks for your continued interest, Bob. > > TJG > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -- http://search.goldwatches.com/?Search=Movado+Watches http://www.jewelerslounge.com http://www.goldwatches.com/mens/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgailer at gmail.com Mon May 26 04:45:35 2008 From: bgailer at gmail.com (bob gailer) Date: Sun, 25 May 2008 22:45:35 -0400 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <00ce01c8be39$0b5f08d0$221d1a70$@com.au> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> Message-ID: <483A244F.2060701@gmail.com> Mark Hammond wrote: > In general, I *try* and stick to the Python Style Guide > (http://www.python.org/dev/peps/pep-0008/) Interesting. I don't like the idea of 2 spaces after a period. Internet research on this topic seems to favor one space. I notice when a PEP is set in monospace there are 2 spaces after periods, otherwise 1 space. That seems inconsistent. -- Bob Gailer 919-636-4239 Chapel Hill, NC From Andrew.MacIntyre at acma.gov.au Mon May 26 06:04:21 2008 From: Andrew.MacIntyre at acma.gov.au (Andrew MacIntyre) Date: Mon, 26 May 2008 14:04:21 +1000 Subject: [python-win32] Request for comments - the spaces issue [SEC=PERSONAL] In-Reply-To: <483A244F.2060701@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk><00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> Message-ID: <7B01D7143C4AD54899EA079D4557562A5CDCC9@ACT01EXC02.internal.govt> > Interesting. I don't like the idea of 2 spaces after a period. > Internet research on this topic seems to favor one space. > > I notice when a PEP is set in monospace there are 2 spaces after > periods, otherwise 1 space. That seems inconsistent. It's not as inconsistent as might seem, as the two spaces after a period rule comes from monospaced typewriters where the period occupies a full character width. The 1 space after a period rule applies to proportional fonts fonts where the period is much narrower than the adjacent characters or the space. -------------------------> "These thoughts are mine alone!" <--------- Andrew MacIntyre National Licensing and Allocations Branch tel: +61 2 6219 5356 Inputs to Industry Division fax: +61 2 6253 3277 Australian Communications & Media Authority email: andrew.macintyre at acma.gov.au If you have received this email in error, please notify the sender immediately and erase all copies of the email and any attachments to it. The information contained in this email and any attachments may be private, confidential and legally privileged or the subject of copyright. If you are not the addressee it may be illegal to review, disclose, use, forward, or distribute this email and/or its contents. Unless otherwise specified, the information in the email and any attachments is intended as a guide only and should not be relied upon as legal or technical advice or regarded as a substitute for legal or technical advice in individual cases. Opinions contained in this email or any of its attachments do not necessarily reflect the opinions of ACMA. From mail at timgolden.me.uk Mon May 26 07:37:42 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Mon, 26 May 2008 06:37:42 +0100 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483A244F.2060701@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> Message-ID: <483A4CA6.1000702@timgolden.me.uk> bob gailer wrote: > Mark Hammond wrote: >> In general, I *try* and stick to the Python Style Guide >> (http://www.python.org/dev/peps/pep-0008/) > > Interesting. I don't like the idea of 2 spaces after a period. Internet > research on this topic seems to favor one space. As it happens I'm with you on this one, but it's one of those aesthetic things where there's no "right" answer: some people prefer one approach; some another. Any organisation setting out its stall simply opts for some position to achieve consistency. [*] As Mark H pointed out earlier, some (most?) projects will insist on your following their style guidelines, which seems fair enough. However I don't see those guidelines (PEP8 in our case) as meaning that I should format *my* code, even code which is published, in the same way if it doesn't suit me. Opinions definitely vary on this matter :) TJG [*] Notwithstanding proportional vs fixed differences! From tejovathi.p at gmail.com Mon May 26 14:39:54 2008 From: tejovathi.p at gmail.com (Tejovathi P) Date: Mon, 26 May 2008 18:09:54 +0530 Subject: [python-win32] Py2exe and win32com.shell In-Reply-To: <9670a730805230606l8edffa8jca6984ce327666fd@mail.gmail.com> References: <9670a730805230606l8edffa8jca6984ce327666fd@mail.gmail.com> Message-ID: Hi Norm.. Thanks for your reply,.. I tried to include the win32com package using "includes" option as well as "package" option. But still the same error reappears " Import error: No module named shell" !! Any pointers???? -Teja On 5/23/08, Norm Petterson wrote: > > > > On Fri, May 23, 2008 at 8:18 AM, Tejovathi P > wrote: > >> >> >> I opened pythonwin and tried importing wincom.shell. Its working >> fine.....!!!!! Then where am I doing wrong.... >> >> > > Hello Tejovathi, > > Googling py2exe win32com gave this reference among the first few: > > http://www.wiredfool.com/2006/11/18/python-and-com-components/ > > containing this clue: > > *The final wrinkle in this exercise is packaging using py2exe. Win32com > needs to be added as a package in the setup.py, > > *HTH, > > Norm > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From billburns at pennswoods.net Tue May 27 02:55:30 2008 From: billburns at pennswoods.net (Bill Burns) Date: Mon, 26 May 2008 20:55:30 -0400 Subject: [python-win32] Py2exe and win32com.shell In-Reply-To: References: Message-ID: <483B5C02.3060405@pennswoods.net> Tejovathi P wrote: > Hi all... > > I created an exe for my application. While generating the exe, py2exe > reports that win32com.shell module is not found and continues generating > exe. > When I try to run the exe, I get an import error that "No module named > shell"....... > Take a look at this page: http://www.py2exe.org/index.cgi/WinShell HTH, Bill From tejovathi.p at gmail.com Tue May 27 06:45:36 2008 From: tejovathi.p at gmail.com (Tejovathi P) Date: Tue, 27 May 2008 10:15:36 +0530 Subject: [python-win32] Py2exe and win32com.shell In-Reply-To: <483B5C02.3060405@pennswoods.net> References: <483B5C02.3060405@pennswoods.net> Message-ID: hi.... Thanks all.....It worked like a charm!!!!!!!!! Thanks once again! -Tejovathi On 5/27/08, Bill Burns wrote: > > Tejovathi P wrote: > >> Hi all... >> I created an exe for my application. While generating the exe, py2exe >> reports that win32com.shell module is not found and continues generating >> exe. >> When I try to run the exe, I get an import error that "No module named >> shell"....... >> >> > > > > Take a look at this page: > > http://www.py2exe.org/index.cgi/WinShell > > HTH, > > Bill > -------------- next part -------------- An HTML attachment was scrubbed... URL: From le.dahut at laposte.net Tue May 27 12:17:46 2008 From: le.dahut at laposte.net (le dahut) Date: Tue, 27 May 2008 12:17:46 +0200 Subject: [python-win32] Vista, _winreg and "Access denied" Message-ID: <483BDFCA.6020807@laposte.net> Hello With Vista (XP works fine), when using SetValueEx in a script ran by an administrator I get "Access Denied". I know that's it's due to UAC so does someone know how to do a 'sudo' when using something else than CreateProcess ? From mail at timgolden.me.uk Tue May 27 13:08:19 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 27 May 2008 12:08:19 +0100 Subject: [python-win32] Vista, _winreg and "Access denied" In-Reply-To: <483BDFCA.6020807@laposte.net> References: <483BDFCA.6020807@laposte.net> Message-ID: <483BEBA3.903@timgolden.me.uk> le dahut wrote: > Hello > > With Vista (XP works fine), when using SetValueEx in a script ran by an > administrator I get "Access Denied". I know that's it's due to UAC so > does someone know how to do a 'sudo' when using something else than > CreateProcess ? I'm not on Vista at the mo, so this is a very tentative reply, but this article: http://www.codeproject.com/KB/vista-security/VistaElevator.aspx looks useful. Do let us know if it is or isn't because I'm sure this question is going to come up more and more. TJG From mdriscoll at co.marshall.ia.us Tue May 27 15:53:07 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Tue, 27 May 2008 08:53:07 -0500 Subject: [python-win32] Request for comments In-Reply-To: <48386884.2050101@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <48382816.9030907@gmail.com> <48386884.2050101@timgolden.me.uk> Message-ID: <483C1243.8070606@co.marshall.ia.us> Tim Golden wrote: >
bob > gailer wrote: >> Tim Roberts wrote: >>> bob gailer wrote: >>>> >>>> Please omit the space before ( in code. I find that very >>>> distracting. Example: >>>> >>>> print result.Properties_ ("sValue").Value # current >>>> >>>> print result.Properties_("sValue").Value # preferred, and how most >>>> code I've seen looks. >>> >>> Do you understand that this is strictly a personal preference? Some >>> people like it, some people don't. You are certainly allowed to >>> "prefer" one over the other, but it's a bit much to ask someone else >>> to change their coding style to match yours, unless you are a paying >>> client. ;) >> >> I agree. Please consider that all of the code examples I've seen in >> the official Python documentation have no space before the (. Most >> newcomers to Python who goes thru the tutorial will learn that way of >> coding. I imagine it would be confusing for them to later see code >> with the space. Same true for Python cookbook. Follow Tim's link to >> Windows Registry Functions >> . >> MS's examples. Ditto. I'm aiming for consistency, and minimal >> confusion for many. > > It's a fair point. For now (basically because I can do it faster) > I'll go with my spaces-before convention. When I get a chance to > breathe we can revisit this and other other coding style issues. > All the example code is in individual Python files so a global > search-and-replace should be possible if it becomes desirable. > > [... snip description of problems with the PythonWin interpreter ...] > > Yes, I tried that to see what you meant. I'm not sure there's > much I'm going to be able to do about that, unless someone > jumps in with a solution. My main point about the examples is > that they're self-contained. (ie you don't need to prearrange > any data or install any modules unless indicated). The ability > to drop them into a Python interpreter window is a nice-to-have > which I make use of whenever I'm posting code. > > If anyone can suggest anything here, even in the form of a hint > in the docs, please let me know. Well, there's at least 2 ways around this. 1) Change it to: import win32api; import win32con (note the important semi-colon) 2) Change it to: import win32api, win32con > > Thanks for your continued interest, Bob. > > TJG > >
I personally like to use my delete key, so when I try to copy and paste something like this into IDLE or PythonWin, I position my cursor at the end of the first import, add a semi-colon and hit delete until the 2nd import jumps to the first line. However, any code that is more than one statement, I tend to copy into a blank file and save it before running it, which circumvents this issue entirely. Mike From mail at timgolden.me.uk Tue May 27 16:00:04 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 27 May 2008 15:00:04 +0100 Subject: [python-win32] Request for comments In-Reply-To: <483C1243.8070606@co.marshall.ia.us> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <48382816.9030907@gmail.com> <48386884.2050101@timgolden.me.uk> <483C1243.8070606@co.marshall.ia.us> Message-ID: <483C13E4.8040003@timgolden.me.uk> Mike Driscoll wrote: > Tim Golden wrote: >> Yes, I tried that to see what you meant. I'm not sure there's >> much I'm going to be able to do about that, unless someone >> jumps in with a solution. My main point about the examples is >> that they're self-contained. (ie you don't need to prearrange >> any data or install any modules unless indicated). The ability >> to drop them into a Python interpreter window is a nice-to-have >> which I make use of whenever I'm posting code. >> >> If anyone can suggest anything here, even in the form of a hint >> in the docs, please let me know. > > Well, there's at least 2 ways around this. > > 1) Change it to: import win32api; import win32con (note the > important semi-colon) > 2) Change it to: import win32api, win32con That's fine for two lines, but I can't change a whole script to work that way :) The intepreter window in PythonWin just doesn't work the same way as the conventional console-based one, it seems. > However, any code that is more than one statement, I tend to copy into a > blank file and save it before running it, which circumvents this issue > entirely. Fair enough, and I think that my main point is that the code can run as-is, without needing any kind of setup. Pasting it direct into an interpreter session is handy to check it runs, but it's not a must-have. TJG From mhammond at skippinet.com.au Tue May 27 16:12:34 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Wed, 28 May 2008 00:12:34 +1000 Subject: [python-win32] Request for comments In-Reply-To: <483C13E4.8040003@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <48382816.9030907@gmail.com> <48386884.2050101@timgolden.me.uk> <483C1243.8070606@co.marshall.ia.us> <483C13E4.8040003@timgolden.me.uk> Message-ID: <027101c8c003$b66d2420$23476c60$@com.au> TimG writes: > That's fine for two lines, but I can't change a whole script to work > that way :) The intepreter window in PythonWin just doesn't work > the same way as the conventional console-based one, it seems. Yeah - it is pretty dumb. I'd love to make pythonwin smarter in this regard though, but the best I can realistically hope for is patches. Cheers, Mark From mhammond at skippinet.com.au Tue May 27 16:02:15 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Wed, 28 May 2008 00:02:15 +1000 Subject: [python-win32] Vista, _winreg and "Access denied" In-Reply-To: <483BDFCA.6020807@laposte.net> References: <483BDFCA.6020807@laposte.net> Message-ID: <027001c8c002$46d3c390$d47b4ab0$@com.au> > With Vista (XP works fine), when using SetValueEx in a script ran by an > administrator I get "Access Denied". I know that's it's due to UAC so > does someone know how to do a 'sudo' when using something else than > CreateProcess ? The short version of my understanding of Vista and UAC: Firstly, an existing process can not be elevated - once you are running, you are out of luck - your option is, basically, re-execute yourself requesting elevation and have the new process retry the operation (the exception is when you are using a COM object - in which case you can ask for an "elevated" COM object - but that is rare, so I'm treating it as the exception :) If you want to reexecute yourself, IIUC you are limited to calling ShellExecute(Ex), with the "verb" set to "runas" - which can be a PITA, but I'm not aware of other options. My current best guess for when you might *need* to do this if is win32com.shell.IsUserAnAdmin() returns true (which needs pywin32-211, which I promise is in the process of being tested right now :) As Tim said though, please read MSDN and all other references you can find, and please correct me if I'm wrong/mistaken/confused/etc for everyone elses benefit... Cheers, Mark From mail at timgolden.me.uk Tue May 27 17:47:34 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 27 May 2008 16:47:34 +0100 Subject: [python-win32] Docs & bonus: pywin32 docs Message-ID: <483C2D16.4040707@timgolden.me.uk> Thanks to everyone who's replied and commented onlist and in private mail. Hopefully within the next few days I'll have completed at least one more section of the docs and I'll announce the project more formally on c.l.py etc. Please feel free to continue to comment and to contribute ideas and suggestions. Meanwhile, as a side effect of needing to link to various parts of the pywin32 docs, I've uploaded an online version of the pywin32 documentation set here: http://timgolden.me.uk/pywin32-docs It's merely a copy of the decompiled .chm, very slightly munged to make the HTML work properly. Hopefully it can be of benefit to others, too. There's no built-in search, but Google's usually quite quick to pick up changes, so hopefully in a bit you'll be able to put: site:timgolden.me.uk/pywin32-docs privileges into Google and see some useful results. TJG From simon.dahlbacka at gmail.com Tue May 27 19:10:35 2008 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Tue, 27 May 2008 20:10:35 +0300 Subject: [python-win32] Docs & bonus: pywin32 docs In-Reply-To: <483C2D16.4040707@timgolden.me.uk> References: <483C2D16.4040707@timgolden.me.uk> Message-ID: <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> Very nice, however you might want to fix the code samples to be properly indented instead of collapsed whitespace.. regards, Simon On Tue, May 27, 2008 at 6:47 PM, Tim Golden wrote: > Thanks to everyone who's replied and commented onlist and in private mail. > Hopefully within the next few days I'll have completed at least one more > section > of the docs and I'll announce the project more formally on c.l.py etc. > Please feel free to continue to comment and to contribute ideas and > suggestions. > > Meanwhile, as a side effect of needing to link to various parts of the > pywin32 > docs, I've uploaded an online version of the pywin32 documentation set > here: > > http://timgolden.me.uk/pywin32-docs > > It's merely a copy of the decompiled .chm, very slightly munged to make > the HTML work properly. Hopefully it can be of benefit to others, too. > There's no built-in search, but Google's usually quite quick to pick up > changes, so hopefully in a bit you'll be able to put: > > site:timgolden.me.uk/pywin32-docs privileges > > into Google and see some useful results. > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue May 27 19:16:55 2008 From: timr at probo.com (Tim Roberts) Date: Tue, 27 May 2008 10:16:55 -0700 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483A244F.2060701@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> Message-ID: <483C4207.2030307@probo.com> bob gailer wrote: > Mark Hammond wrote: >> In general, I *try* and stick to the Python Style Guide >> (http://www.python.org/dev/peps/pep-0008/) > > Interesting. I don't like the idea of 2 spaces after a period. > Internet research on this topic seems to favor one space. I'm not sure where you got that. Internet research seems to show that there is no agreement on this topic at all. It is interesting to me that this single topic (spacing after a full stop) occupies an entire Wikipedia article, with no less than 114 referenced footnotes (http://en.wikipedia.org/wiki/Double_spacing). If anything, research shows that two spaces after a period increases reader comprehension, but font designers don't like the aesthetics. The general trend these days is toward one space, but they'll never stop me. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Tue May 27 19:32:39 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 27 May 2008 18:32:39 +0100 Subject: [python-win32] Docs & bonus: pywin32 docs In-Reply-To: <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> References: <483C2D16.4040707@timgolden.me.uk> <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> Message-ID: <483C45B7.7080903@timgolden.me.uk> Simon Dahlbacka wrote: > Very nice, however you might want to fix the code samples to be properly > indented instead of collapsed whitespace.. Can you point me towards an example? TJG From mdriscoll at co.marshall.ia.us Tue May 27 19:34:50 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Tue, 27 May 2008 12:34:50 -0500 Subject: [python-win32] Request for comments In-Reply-To: <483C13E4.8040003@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <48382816.9030907@gmail.com> <48386884.2050101@timgolden.me.uk> <483C1243.8070606@co.marshall.ia.us> <483C13E4.8040003@timgolden.me.uk> Message-ID: <483C463A.8050909@co.marshall.ia.us> Tim Golden wrote: >
Mike > Driscoll wrote: >> Tim Golden wrote: >>> Yes, I tried that to see what you meant. I'm not sure there's >>> much I'm going to be able to do about that, unless someone >>> jumps in with a solution. My main point about the examples is >>> that they're self-contained. (ie you don't need to prearrange >>> any data or install any modules unless indicated). The ability >>> to drop them into a Python interpreter window is a nice-to-have >>> which I make use of whenever I'm posting code. >>> >>> If anyone can suggest anything here, even in the form of a hint >>> in the docs, please let me know. >> >> Well, there's at least 2 ways around this. >> >> 1) Change it to: import win32api; import win32con (note the >> important semi-colon) >> 2) Change it to: import win32api, win32con > > That's fine for two lines, but I can't change a whole script to work > that way :) The intepreter window in PythonWin just doesn't work > the same way as the conventional console-based one, it seems. > >> However, any code that is more than one statement, I tend to copy >> into a blank file and save it before running it, which circumvents >> this issue entirely. > > Fair enough, and I think that my main point is that the code can run > as-is, without needing any kind of setup. Pasting it direct into an > interpreter session is handy to check it runs, but it's not a must-have. > > TJG > >
True enough. I was only commenting on what the OP was commenting on. Putting semi-colons throughout would make for pretty ugly looking code. Mike From Kyle.Rickey at bakerhughes.com Tue May 27 19:26:45 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Tue, 27 May 2008 12:26:45 -0500 Subject: [python-win32] Dispatch InternetExplorer.Application fails Message-ID: Whenever I try the following: >> import win32com.client >> ie = win32com.client.Dispatch("InternetExplorer.Application") I get this traceback: Traceback (most recent call last): File "", line 1, in File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line 98, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line 78, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) com_error: (-2147024894, 'The system cannot find the file specified.', None, None) Any ideas what would cause this? My end goal is to COM into IE and load an xml file, then print it to PDF. -Kyle Rickey From mail at timgolden.me.uk Tue May 27 21:46:10 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 27 May 2008 20:46:10 +0100 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: References: Message-ID: <483C6502.6070001@timgolden.me.uk> Rickey, Kyle W wrote: > Whenever I try the following: > >>> import win32com.client >>> ie = win32com.client.Dispatch("InternetExplorer.Application") > > I get this traceback: > > Traceback (most recent call last): > File "", line 1, in > File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line > 95, in Dispatch > dispatch, userName = > dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line > 98, in _GetGoodDispatchAndUserName > return (_GetGoodDispatch(IDispatch, clsctx), userName) > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line > 78, in _GetGoodDispatch > IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, > pythoncom.IID_IDispatch) > com_error: (-2147024894, 'The system cannot find the file specified.', > None, None) > > Any ideas what would cause this? My end goal is to COM into IE and load > an xml file, then print it to PDF. FWIW, you might find it worth looking at PAMIE which uses COM the way you're doing, but which has already ironed out a few creases. That said, it doesn't really answer your question. Can you see what result this script gives: import os import _winreg hKey = _winreg.OpenKey ( _winreg.HKEY_CLASSES_ROOT, r"InternetExplorer.Application\CLSID" ) clsid, type = _winreg.QueryValueEx (hKey, "") print clsid hKey = _winreg.OpenKey ( _winreg.HKEY_CLASSES_ROOT, r"CLSID\%s\LocalServer32" % clsid ) server, type = _winreg.QueryValueEx (hKey, "") print server, os.path.exists (server.strip ('"')) This should, crudely, go through the same steps that the Dispatch process does and should show up whether IE's not where it thinks it should be. The strip () on the server name is because, on my machine, the location is double-quoted, presumably because it's got an embedded space which would cause some problem in the mechanism. TJG From Kyle.Rickey at bakerhughes.com Tue May 27 22:41:21 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Tue, 27 May 2008 15:41:21 -0500 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: <483C6502.6070001@timgolden.me.uk> References: <483C6502.6070001@timgolden.me.uk> Message-ID: Tim, thanks for your response. I realize where I've got this messed up. I had turned off Windows File Protection for C:\Program Files\Internet Explorer So that I could replace internet explorer with my own executable that calls firefox :) The reason for this is some of our proprietary software is hardcoded to launch files in IE, but there are advantages to using firefox instead. Anyway, that's a bit off topic. I restored the real IE and rebooted and now >> ie = win32com.client.Dispatch("InternetExplorer.Application") works as expected. I'm also checking out PAMIE but I'm beginning to think I may be going about this whole thing the wrong way. Basically, said software above generates reports as xml files. The xml file references an xsl file used to transform the report. This xml gets launched and transformed by IE. What we want to happen is a way to take that xml file and go to PDF. As it is now we have to print from IE to the Adobe Acrobat PDF printer. This is cumbersome for the amount of reports that need run. So here are some solutions I was considering: 1) COM into IE and load the xml, print it to PDF. Works, but we still get prompted for the file name to save the pdf as (my code could supply an appropriate name) 2) use some python libraries (libxml2, libxslt) to transform the xml to html. That part works but now how to I make a pdf from the html file? 3) COM into Adobe Acrobat and generate the pdf (no idea where to begin) 4) Rewrite entire reporting system to use pdf natively. Since the data is freely available in our SQL server, this would be possible, but very time consuming. I'm open to suggestions on a better way to go about this. Also, assuming I changed the registry to point to iexplore2 (original IE) would COM'ing into work? Kyle Rickey -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden Sent: Tuesday, May 27, 2008 2:46 PM Cc: python-win32 at python.org Subject: Re: [python-win32] Dispatch InternetExplorer.Application fails Rickey, Kyle W wrote: > Whenever I try the following: > >>> import win32com.client >>> ie = win32com.client.Dispatch("InternetExplorer.Application") > > I get this traceback: > > Traceback (most recent call last): > File "", line 1, in > File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line > 95, in Dispatch > dispatch, userName = > dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line > 98, in _GetGoodDispatchAndUserName > return (_GetGoodDispatch(IDispatch, clsctx), userName) > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line > 78, in _GetGoodDispatch > IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, > pythoncom.IID_IDispatch) > com_error: (-2147024894, 'The system cannot find the file specified.', > None, None) > > Any ideas what would cause this? My end goal is to COM into IE and load > an xml file, then print it to PDF. FWIW, you might find it worth looking at PAMIE which uses COM the way you're doing, but which has already ironed out a few creases. That said, it doesn't really answer your question. Can you see what result this script gives: import os import _winreg hKey = _winreg.OpenKey ( _winreg.HKEY_CLASSES_ROOT, r"InternetExplorer.Application\CLSID" ) clsid, type = _winreg.QueryValueEx (hKey, "") print clsid hKey = _winreg.OpenKey ( _winreg.HKEY_CLASSES_ROOT, r"CLSID\%s\LocalServer32" % clsid ) server, type = _winreg.QueryValueEx (hKey, "") print server, os.path.exists (server.strip ('"')) This should, crudely, go through the same steps that the Dispatch process does and should show up whether IE's not where it thinks it should be. The strip () on the server name is because, on my machine, the location is double-quoted, presumably because it's got an embedded space which would cause some problem in the mechanism. TJG _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 From Ron.Henderson at dreamworks.com Tue May 27 23:08:50 2008 From: Ron.Henderson at dreamworks.com (Ron Henderson) Date: Tue, 27 May 2008 14:08:50 -0700 Subject: [python-win32] MSProject and export maps In-Reply-To: <4836C330.2030503@timgolden.me.uk> References: <483683F5.5030901@timgolden.me.uk> <4836C330.2030503@timgolden.me.uk> Message-ID: <483C7862.70705@dreamworks.com> Thanks so much for trying this out. You've verified that it's possible to get this working. However, when I execute the same code, the file "p2.csv" is exactly same size as p1.mpp and contains binary data, not the text. Since you have it working it must be a bug in either my version of MSProject or win32com. I'm using: MSProject 2003 Python 2.5.2 pywin32-210 Could you verify which versions you tested with? Tim Golden wrote: >>> >>> import win32com.client >>> >>> project = win32com.client.Dispatch ("MSProject.Application") >>> project.FileOpen ("c:/temp/p1.mpp") >>> project.FileSaveAs (Name="c:/temp/p2.csv", FormatID="MSProject.CSV", >>> Map="p1") >>> project.FileClose (Save=0) >>> project.FileQuit () >>> >>> > > I hadn't thought to check but, yes, it is: > > > Name,Actual_Cost > Do something,?0.00 > > > Sorry not to be much more help; I'm not really an MS Project man myself. > > TJG From bgailer at gmail.com Wed May 28 01:59:53 2008 From: bgailer at gmail.com (bob gailer) Date: Tue, 27 May 2008 19:59:53 -0400 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483C4207.2030307@probo.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> Message-ID: <483CA079.4090904@gmail.com> Tim Roberts wrote: > bob gailer wrote: >> Mark Hammond wrote: >>> In general, I *try* and stick to the Python Style Guide >>> (http://www.python.org/dev/peps/pep-0008/) >> >> Interesting. I don't like the idea of 2 spaces after a period. >> Internet research on this topic seems to favor one space. > > I'm not sure where you got that. I googled "sites favoring 1 space after a period" *joke* I guess I did not read enough. The articles I read seemed to lean toward one space. > Internet research seems to show that there is no agreement on this > topic at all. It is interesting to me that this single topic (spacing > after a full stop) occupies an entire Wikipedia article, with no less > than 114 referenced footnotes > (http://en.wikipedia.org/wiki/Double_spacing). > > If anything, research shows that two spaces after a period increases > reader comprehension, For me I notice reading the above (especially in monospace font) the 2 spaces are jarring, and distract me from the material I'm reading. > but font designers don't like the aesthetics. The general trend these > days is toward one space, but they'll never stop me. What's really weird: The Harbrace College handbook says "Two spaces follow the period, question mark ...." Yet the book consistently uses one space in its own text! -- Bob Gailer 919-636-4239 Chapel Hill, NC From mail at timgolden.me.uk Wed May 28 09:37:42 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 28 May 2008 08:37:42 +0100 Subject: [python-win32] MSProject and export maps In-Reply-To: <483C7862.70705@dreamworks.com> References: <483683F5.5030901@timgolden.me.uk> <4836C330.2030503@timgolden.me.uk> <483C7862.70705@dreamworks.com> Message-ID: <483D0BC6.1030106@timgolden.me.uk> Ron Henderson wrote: > Thanks so much for trying this out. You've verified that it's possible > to get this working. > > However, when I execute the same code, the file "p2.csv" is exactly same > size as p1.mpp and contains binary data, not the text. Since you have > it working it must be a bug in either my version of MSProject or > win32com. I'm using: > > MSProject 2003 > Python 2.5.2 > pywin32-210 > > Could you verify which versions you tested with? Certainly Python 2.5.2 and pywin32-210. I'll have to go back to the machine I used MSProject on to check the other. I'll let you know. TJG From theller at ctypes.org Wed May 28 10:16:54 2008 From: theller at ctypes.org (Thomas Heller) Date: Wed, 28 May 2008 10:16:54 +0200 Subject: [python-win32] Docs & bonus: pywin32 docs In-Reply-To: <483C45B7.7080903@timgolden.me.uk> References: <483C2D16.4040707@timgolden.me.uk> <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> <483C45B7.7080903@timgolden.me.uk> Message-ID: Tim Golden schrieb: > Simon Dahlbacka wrote: >> Very nice, however you might want to fix the code samples to be properly >> indented instead of collapsed whitespace.. > > Can you point me towards an example? Here's an example: http://timgolden.me.uk/pywin32-docs/html/win32/help/process_info.html Thomas From mail at timgolden.me.uk Wed May 28 10:32:22 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 28 May 2008 09:32:22 +0100 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483CA079.4090904@gmail.com> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> Message-ID: <483D1896.8040007@timgolden.me.uk> bob gailer wrote: > Tim Roberts wrote: >> bob gailer wrote: >>> Mark Hammond wrote: >>>> In general, I *try* and stick to the Python Style Guide >>>> (http://www.python.org/dev/peps/pep-0008/) >>> >>> Interesting. I don't like the idea of 2 spaces after a period. >>> Internet research on this topic seems to favor one space. >> >> I'm not sure where you got that. > > I googled "sites favoring 1 space after a period" > > *joke* > For me I notice reading the above (especially in monospace font) the 2 > spaces are jarring, and distract me from the material I'm reading. FWIW, I'm with you on that. But I think it's just one of those aesthetic / what-you-grew-up-with things. You're never going to find consensus, only an amicable compromise. Or a house-style to follow. > What's really weird: The Harbrace College handbook says "Two spaces > follow the period, question mark ...." Yet the book consistently uses > one space in its own text! Editors: who needs 'em? TJG From mail at timgolden.me.uk Wed May 28 10:32:28 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 28 May 2008 09:32:28 +0100 Subject: [python-win32] MSProject and export maps In-Reply-To: <483C7862.70705@dreamworks.com> References: <483683F5.5030901@timgolden.me.uk> <4836C330.2030503@timgolden.me.uk> <483C7862.70705@dreamworks.com> Message-ID: <483D189C.7060002@timgolden.me.uk> Ron Henderson wrote: > Thanks so much for trying this out. You've verified that it's possible > to get this working. > > However, when I execute the same code, the file "p2.csv" is exactly same > size as p1.mpp and contains binary data, not the text. Since you have > it working it must be a bug in either my version of MSProject or > win32com. I'm using: (BTW Office Project Standard 2003 11.0.2003.0816.15) Also, and please don't take this the wrong way, could you post a screen dump of your interpreter window, showing the (equivalent) code *and the output file*. I attach mine below. What I'm trying to eliminate is one of those annoying typo-thinko errors we all make where we pass the wrong filename or something and don't notice. Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import win32com.client >>> >>> project = win32com.client.Dispatch ("MSProject.Application") >>> project.FileOpen ("c:/temp/p1.mpp") True >>> FILENAME = "c:/temp/p2.csv" >>> project.FileSaveAs (Name=FILENAME, FormatID="MSProject.CSV", Map="p1") True >>> project.FileClose (Save=0) True >>> project.FileQuit () True >>> print open (FILENAME).read () Name,Actual_Cost Do something,?0.00 >>> Because I was reusing a filename, I had to press the [OK] to overwrite somewhere in the FileSaveAs manoeuvre. Doubt it made a difference. TJG From mail at timgolden.me.uk Wed May 28 10:56:25 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 28 May 2008 09:56:25 +0100 Subject: [python-win32] Docs & bonus: pywin32 docs In-Reply-To: References: <483C2D16.4040707@timgolden.me.uk> <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> <483C45B7.7080903@timgolden.me.uk> Message-ID: <483D1E39.8090601@timgolden.me.uk> Thomas Heller wrote: > Tim Golden schrieb: >> Simon Dahlbacka wrote: >>> Very nice, however you might want to fix the code samples to be properly >>> indented instead of collapsed whitespace.. >> Can you point me towards an example? > > Here's an example: > > http://timgolden.me.uk/pywin32-docs/html/win32/help/process_info.html Thanks, Thomas. Simon replied in a private email with a whole list of them which I'll be trying to get to soon(ish). TJG From gerdusvanzyl at gmail.com Wed May 28 11:11:24 2008 From: gerdusvanzyl at gmail.com (Gerdus van Zyl) Date: Wed, 28 May 2008 11:11:24 +0200 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: References: <483C6502.6070001@timgolden.me.uk> Message-ID: <91882ea90805280211i2a8398b0k7f9b45a5444be19f@mail.gmail.com> Have you seen www.htmltopdf.org? Otherwise might I suggest http://www.openreport.org/; you could then transform your XML into RML(xml reporting format) into a PDF. You can also design RML with OpenOffice. ~Gerdus On Tue, May 27, 2008 at 10:41 PM, Rickey, Kyle W < Kyle.Rickey at bakerhughes.com> wrote: > Tim, thanks for your response. I realize where I've got this messed up. > > I had turned off Windows File Protection for > C:\Program Files\Internet Explorer > So that I could replace internet explorer with my own executable that > calls firefox :) The reason for this is some of our proprietary software > is hardcoded to launch files in IE, but there are advantages to using > firefox instead. > > Anyway, that's a bit off topic. I restored the real IE and rebooted and > now > >> ie = win32com.client.Dispatch("InternetExplorer.Application") > works as expected. > > I'm also checking out PAMIE but I'm beginning to think I may be going > about this whole thing the wrong way. > > Basically, said software above generates reports as xml files. The xml > file references an xsl file used to transform the report. This xml gets > launched and transformed by IE. > > What we want to happen is a way to take that xml file and go to PDF. As > it is now we have to print from IE to the Adobe Acrobat PDF printer. > This is cumbersome for the amount of reports that need run. So here are > some solutions I was considering: > > 1) COM into IE and load the xml, print it to PDF. Works, but we still > get prompted for the file name to save the pdf as (my code could supply > an appropriate name) > > 2) use some python libraries (libxml2, libxslt) to transform the xml to > html. That part works but now how to I make a pdf from the html file? > > 3) COM into Adobe Acrobat and generate the pdf (no idea where to begin) > > 4) Rewrite entire reporting system to use pdf natively. Since the data > is freely available in our SQL server, this would be possible, but very > time consuming. > > I'm open to suggestions on a better way to go about this. Also, assuming > I changed the registry to point to iexplore2 (original IE) would COM'ing > into work? > > Kyle Rickey > -----Original Message----- > From: python-win32-bounces at python.org > [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden > Sent: Tuesday, May 27, 2008 2:46 PM > Cc: python-win32 at python.org > Subject: Re: [python-win32] Dispatch InternetExplorer.Application fails > > Rickey, Kyle W wrote: > > Whenever I try the following: > > > >>> import win32com.client > >>> ie = win32com.client.Dispatch("InternetExplorer.Application") > > > > I get this traceback: > > > > Traceback (most recent call last): > > File "", line 1, in > > File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", > line > > 95, in Dispatch > > dispatch, userName = > > dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) > > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", > line > > 98, in _GetGoodDispatchAndUserName > > return (_GetGoodDispatch(IDispatch, clsctx), userName) > > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", > line > > 78, in _GetGoodDispatch > > IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, > > pythoncom.IID_IDispatch) > > com_error: (-2147024894, 'The system cannot find the file specified.', > > None, None) > > > > Any ideas what would cause this? My end goal is to COM into IE and > load > > an xml file, then print it to PDF. > > FWIW, you might find it worth looking at PAMIE which uses COM > the way you're doing, but which has already ironed out a few > creases. That said, it doesn't really answer your question. Can > you see what result this script gives: > > > import os > import _winreg > > hKey = _winreg.OpenKey ( > _winreg.HKEY_CLASSES_ROOT, > r"InternetExplorer.Application\CLSID" > ) > clsid, type = _winreg.QueryValueEx (hKey, "") > > print clsid > > hKey = _winreg.OpenKey ( > _winreg.HKEY_CLASSES_ROOT, > r"CLSID\%s\LocalServer32" % clsid > ) > server, type = _winreg.QueryValueEx (hKey, "") > > print server, os.path.exists (server.strip ('"')) > > > > This should, crudely, go through the same steps that > the Dispatch process does and should show up whether > IE's not where it thinks it should be. The strip () > on the server name is because, on my machine, the > location is double-quoted, presumably because it's > got an embedded space which would cause some problem > in the mechanism. > > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kyle.Rickey at bakerhughes.com Wed May 28 15:20:36 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Wed, 28 May 2008 08:20:36 -0500 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: <91882ea90805280211i2a8398b0k7f9b45a5444be19f@mail.gmail.com> References: <483C6502.6070001@timgolden.me.uk> <91882ea90805280211i2a8398b0k7f9b45a5444be19f@mail.gmail.com> Message-ID: Thanks, I'll check out those links. -Kyle Rickey ________________________________ From: Gerdus van Zyl [mailto:gerdusvanzyl at gmail.com] Sent: Wednesday, May 28, 2008 4:11 AM To: Rickey, Kyle W Cc: python-win32 at python.org Subject: Re: [python-win32] Dispatch InternetExplorer.Application fails Have you seen www.htmltopdf.org? Otherwise might I suggest http://www.openreport.org/; you could then transform your XML into RML(xml reporting format) into a PDF. You can also design RML with OpenOffice. ~Gerdus On Tue, May 27, 2008 at 10:41 PM, Rickey, Kyle W wrote: Tim, thanks for your response. I realize where I've got this messed up. I had turned off Windows File Protection for C:\Program Files\Internet Explorer So that I could replace internet explorer with my own executable that calls firefox :) The reason for this is some of our proprietary software is hardcoded to launch files in IE, but there are advantages to using firefox instead. Anyway, that's a bit off topic. I restored the real IE and rebooted and now >> ie = win32com.client.Dispatch("InternetExplorer.Application") works as expected. I'm also checking out PAMIE but I'm beginning to think I may be going about this whole thing the wrong way. Basically, said software above generates reports as xml files. The xml file references an xsl file used to transform the report. This xml gets launched and transformed by IE. What we want to happen is a way to take that xml file and go to PDF. As it is now we have to print from IE to the Adobe Acrobat PDF printer. This is cumbersome for the amount of reports that need run. So here are some solutions I was considering: 1) COM into IE and load the xml, print it to PDF. Works, but we still get prompted for the file name to save the pdf as (my code could supply an appropriate name) 2) use some python libraries (libxml2, libxslt) to transform the xml to html. That part works but now how to I make a pdf from the html file? 3) COM into Adobe Acrobat and generate the pdf (no idea where to begin) 4) Rewrite entire reporting system to use pdf natively. Since the data is freely available in our SQL server, this would be possible, but very time consuming. I'm open to suggestions on a better way to go about this. Also, assuming I changed the registry to point to iexplore2 (original IE) would COM'ing into work? Kyle Rickey -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden Sent: Tuesday, May 27, 2008 2:46 PM Cc: python-win32 at python.org Subject: Re: [python-win32] Dispatch InternetExplorer.Application fails Rickey, Kyle W wrote: > Whenever I try the following: > >>> import win32com.client >>> ie = win32com.client.Dispatch("InternetExplorer.Application") > > I get this traceback: > > Traceback (most recent call last): > File "", line 1, in > File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line > 95, in Dispatch > dispatch, userName = > dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line > 98, in _GetGoodDispatchAndUserName > return (_GetGoodDispatch(IDispatch, clsctx), userName) > File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line > 78, in _GetGoodDispatch > IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, > pythoncom.IID_IDispatch) > com_error: (-2147024894, 'The system cannot find the file specified.', > None, None) > > Any ideas what would cause this? My end goal is to COM into IE and load > an xml file, then print it to PDF. FWIW, you might find it worth looking at PAMIE which uses COM the way you're doing, but which has already ironed out a few creases. That said, it doesn't really answer your question. Can you see what result this script gives: import os import _winreg hKey = _winreg.OpenKey ( _winreg.HKEY_CLASSES_ROOT, r"InternetExplorer.Application\CLSID" ) clsid, type = _winreg.QueryValueEx (hKey, "") print clsid hKey = _winreg.OpenKey ( _winreg.HKEY_CLASSES_ROOT, r"CLSID\%s\LocalServer32" % clsid ) server, type = _winreg.QueryValueEx (hKey, "") print server, os.path.exists (server.strip ('"')) This should, crudely, go through the same steps that the Dispatch process does and should show up whether IE's not where it thinks it should be. The strip () on the server name is because, on my machine, the location is double-quoted, presumably because it's got an embedded space which would cause some problem in the mechanism. TJG _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Wed May 28 17:40:56 2008 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 28 May 2008 09:40:56 -0600 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483D1896.8040007@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> <483D1896.8040007@timgolden.me.uk> Message-ID: Let's not loose track of the thread here. The question was whether there should be a space between the function name and the leading parenthesis, as: my_function (arg) vs: my_function(arg) PEP8 clearly requires the latter. IMHO any published example code, which is what we are talking about here, should follow the PEP8 style guide. (Besides which I personally REALLY hate the extra space.) -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed May 28 18:46:31 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 28 May 2008 09:46:31 -0700 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> <483D1896.8040007@timgolden.me.uk> Message-ID: <483D8C67.80703@probo.com> Vernon Cole wrote: > Let's not loose track of the thread here. > The question was whether there should be a space between the function > name and the leading parenthesis, as: > my_function (arg) > vs: > my_function(arg) > > PEP8 clearly requires the latter. PEP8 is a coding standard document for the Python standard library. Nothing more. It is not a mandate for all Python code. I disagree with several of the conventions in PEP8, although if I ever submit anything to the standard library, I will reformat it to match. The key lesson in that PEP is that you should stick to SOME standard. It need not be the same standard used by others. > IMHO any published example code, which is what we are talking about > here, should follow the PEP8 style guide. No, that's going WAY too far. It is a mandate for the standard library, and it is a starting point for new Python coders. > (Besides which I personally REALLY hate the extra space.) You are entitled to do so. I don't like it either, but I will certainly defend TJG's right to write his code using his own standards. I, personally, like Camel-cased names with an extra space inside the parentheses, both of which are discouraged by PEP8: obj = myFunction( one, two ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Wed May 28 19:36:16 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 28 May 2008 18:36:16 +0100 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> <4837456C.3000902@gmail.com> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> <483D1896.8040007@timgolden.me.uk> Message-ID: <483D9810.9030307@timgolden.me.uk> Vernon Cole wrote: > Let's not loose track of the thread here. > The question was whether there should be a space between the function > name and the leading parenthesis, as: > my_function (arg) > vs: > my_function(arg) > > PEP8 clearly requires the latter. > > IMHO any published example code, which is what we are talking about > here, should follow the PEP8 style guide. > > (Besides which I personally REALLY hate the extra space.) (Whistles quietly to himself and carries on trying to generate as much useful documentation as he can while holding down a day job and looking after a boys' club at weekends :) ) TJG From vernondcole at gmail.com Wed May 28 19:56:14 2008 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 28 May 2008 11:56:14 -0600 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: <483D8C67.80703@probo.com> References: <48359D9B.7040109@timgolden.me.uk> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> <483D1896.8040007@timgolden.me.uk> <483D8C67.80703@probo.com> Message-ID: Tim: I think you missed my point... As you say, the PEP8 style guide "is a starting point for new Python coders." That is precisely why it ought to be followed in sample code. I normally format my function calls exactly the way you do, and I do so in open source code which I contribute to the community. That is not EXAMPLE code which also works, it is working code which might be used as an example: a subtle but important difference. -- Vernon Cole On Wed, May 28, 2008 at 10:46 AM, Tim Roberts wrote: > Vernon Cole wrote: > >> Let's not loose track of the thread here. >> The question was whether there should be a space between the function name >> and the leading parenthesis, as: >> my_function (arg) >> vs: >> my_function(arg) >> >> PEP8 clearly requires the latter. >> > > PEP8 is a coding standard document for the Python standard library. > Nothing more. It is not a mandate for all Python code. I disagree with > several of the conventions in PEP8, although if I ever submit anything to > the standard library, I will reformat it to match. > > The key lesson in that PEP is that you should stick to SOME standard. It > need not be the same standard used by others. > > > IMHO any published example code, which is what we are talking about here, >> should follow the PEP8 style guide. >> > > No, that's going WAY too far. It is a mandate for the standard library, > and it is a starting point for new Python coders. > > > (Besides which I personally REALLY hate the extra space.) >> > > You are entitled to do so. I don't like it either, but I will certainly > defend TJG's right to write his code using his own standards. I, > personally, like Camel-cased names with an extra space inside the > parentheses, both of which are discouraged by PEP8: > > obj = myFunction( one, two ) > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdahlstrom at directedge.com Wed May 28 20:15:35 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Wed, 28 May 2008 14:15:35 -0400 Subject: [python-win32] Request for comments - the spaces issue References: <48359D9B.7040109@timgolden.me.uk> <48374FF1.7090706@probo.com><4837D1A3.8080107@timgolden.me.uk><00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com><483C4207.2030307@probo.com> <483CA079.4090904@gmail.com><483D1896.8040007@timgolden.me.uk><483D8C67.80703@probo.com> Message-ID: I think there are perhaps billions of people who get down on their knees every day and pray to whatever god they believe in that they had such problems as a space between a function name and a parenthesis. For crying out loud, it's a simple search/replace at *worst* to change this to be however you want it. ________________________________ From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Vernon Cole Sent: Wednesday, May 28, 2008 1:56 PM To: Python-Win32 List Subject: Re: [python-win32] Request for comments - the spaces issue Tim: I think you missed my point... As you say, the PEP8 style guide "is a starting point for new Python coders." That is precisely why it ought to be followed in sample code. I normally format my function calls exactly the way you do, and I do so in open source code which I contribute to the community. That is not EXAMPLE code which also works, it is working code which might be used as an example: a subtle but important difference. -- Vernon Cole On Wed, May 28, 2008 at 10:46 AM, Tim Roberts wrote: Vernon Cole wrote: Let's not loose track of the thread here. The question was whether there should be a space between the function name and the leading parenthesis, as: my_function (arg) vs: my_function(arg) PEP8 clearly requires the latter. PEP8 is a coding standard document for the Python standard library. Nothing more. It is not a mandate for all Python code. I disagree with several of the conventions in PEP8, although if I ever submit anything to the standard library, I will reformat it to match. The key lesson in that PEP is that you should stick to SOME standard. It need not be the same standard used by others. IMHO any published example code, which is what we are talking about here, should follow the PEP8 style guide. No, that's going WAY too far. It is a mandate for the standard library, and it is a starting point for new Python coders. (Besides which I personally REALLY hate the extra space.) You are entitled to do so. I don't like it either, but I will certainly defend TJG's right to write his code using his own standards. I, personally, like Camel-cased names with an extra space inside the parentheses, both of which are discouraged by PEP8: obj = myFunction( one, two ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed May 28 20:22:38 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 28 May 2008 11:22:38 -0700 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> <483D1896.8040007@timgolden.me.uk> <483D8C67.80703@probo.com> Message-ID: <483DA2EE.4020100@probo.com> Vernon Cole wrote: > Tim: > I think you missed my point... > As you say, the PEP8 style guide "is a starting point for new Python > coders." > That is precisely why it ought to be followed in sample code. > > I normally format my function calls exactly the way you do, and I do > so in open source code which I contribute to the community. That is > not EXAMPLE code which also works, it is working code which might be > used as an example: a subtle but important difference. But wouldn't you agree that there is a huge difference between official code coming from and endorsed by a member of the Python development team, and sample code contributed from the private library of a helpful member of the general public? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mdriscoll at co.marshall.ia.us Wed May 28 20:44:14 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Wed, 28 May 2008 13:44:14 -0500 Subject: [python-win32] Request for comments - the spaces issue In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> <48374FF1.7090706@probo.com> <4837D1A3.8080107@timgolden.me.uk> <00ce01c8be39$0b5f08d0$221d1a70$@com.au> <483A244F.2060701@gmail.com> <483C4207.2030307@probo.com> <483CA079.4090904@gmail.com> <483D1896.8040007@timgolden.me.uk> <483D8C67.80703@probo.com> Message-ID: <483DA7FE.80606@co.marshall.ia.us> Vernon, > Tim: > I think you missed my point... > As you say, the PEP8 style guide "is a starting point for new Python > coders." > That is precisely why it ought to be followed in sample code. > > I normally format my function calls exactly the way you do, and I do > so in open source code which I contribute to the community. That is > not EXAMPLE code which also works, it is working code which might be > used as an example: a subtle but important difference. > -- > Vernon Cole I always find it interesting when people flip out over semantics like this. This seems especially true when someone is trying to contribute back to the community. I get flak every time I talk about my Python Extension Building Network because people don't like executables and think that everyone should use the command line. I admit that I have found it personally discouraging when this happens, which is why my site doesn't get updated regularly any more. I'm sure I'll get some hate mail over my wxPython tutorials soon since I use camelCase as Tim R. does. Oddly enough, this seems to be the convention in the wxPython camp, which flies in the face of PEP8. I guess I would recommend that you create a mirror site and reformat it to the standards you use. Then Tim can link to your site too. I also recommend that you read Aesop's Fable: "The Man, the boy and the donkey" : http://members.cox.net/deleyd2/prose/aesop63.htm Mike > > On Wed, May 28, 2008 at 10:46 AM, Tim Roberts > wrote: > > Vernon Cole wrote: > > Let's not loose track of the thread here. > The question was whether there should be a space between the > function name and the leading parenthesis, as: > my_function (arg) > vs: > my_function(arg) > > PEP8 clearly requires the latter. > > > PEP8 is a coding standard document for the Python standard > library. Nothing more. It is not a mandate for all Python code. > I disagree with several of the conventions in PEP8, although if I > ever submit anything to the standard library, I will reformat it > to match. > > The key lesson in that PEP is that you should stick to SOME > standard. It need not be the same standard used by others. > > > > IMHO any published example code, which is what we are talking > about here, should follow the PEP8 style guide. > > > No, that's going WAY too far. It is a mandate for the standard > library, and it is a starting point for new Python coders. > > > > (Besides which I personally REALLY hate the extra space.) > > > You are entitled to do so. I don't like it either, but I will > certainly defend TJG's right to write his code using his own > standards. I, personally, like Camel-cased names with an extra > space inside the parentheses, both of which are discouraged by PEP8: > > obj = myFunction( one, two ) > > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > From bgailer at gmail.com Wed May 28 21:03:40 2008 From: bgailer at gmail.com (bob gailer) Date: Wed, 28 May 2008 15:03:40 -0400 Subject: [python-win32] Concerns with PythonWin documentation Message-ID: <483DAC8C.7000309@gmail.com> A few years ago I wrote on this subject and never had a response. Since Tim has put the docs on the Web I revisited them. And I still have questions and concerns. So here goes: Under Keyboard Bindings: What does "Common Keystrokes" mean? What does "Builtin Keystrokes" mean? How are they different from Common Keystrokes? How does mention of Scintilla help me understand or use PyWin in this document? Why is Ctrl+ followed by upper case letters when one must use the lower case equivalent? Ctrl+T says Transpose (swap) the current line with the line above but it really is <>. Regarding the default configuration file: There is a lot of inconsistency (and therefore confusion) in the use of the word Shift. It is claimed that extensive comments help me create my own customization. However the comments do not help me understand the syntax or meaning of the right side of the = Why are some words inside << >> and others not? Where are these words defined? Are there others available? Can we "roll" our own? For example: what is <> What does it mean? What does it do? Up = <> Does Up refer to the uparrow? What is the significance of binding it to <>? It seems to me that would cancel any other use of that key. Or is this an additive thing? I am vary lost when looking at the function defs starting with AddBanner. I can guess some of what's going on but feel helpless about writing my own with success. Please consider adding explanations for these things so I (and a lot of others) could have more confidence. For example I'd really like to have a key to "Transpose (swap) the current line with the line above". I'd be glad to write my own if I knew how to. Also where is Ctrl+d documented? It seems to duplicate the current line! Are there other undocumented useful key bindings? -- Bob Gailer 919-636-4239 Chapel Hill, NC From timr at probo.com Wed May 28 21:15:58 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 28 May 2008 12:15:58 -0700 Subject: [python-win32] Concerns with PythonWin documentation In-Reply-To: <483DAC8C.7000309@gmail.com> References: <483DAC8C.7000309@gmail.com> Message-ID: <483DAF6E.4030407@probo.com> bob gailer wrote: > A few years ago I wrote on this subject and never had a response. > Since Tim has put the docs on the Web I revisited them. And I still > have questions and concerns. So here goes: > ... > Under Keyboard Bindings: > ... > Why is Ctrl+ followed by upper case letters when one must use the > lower case equivalent? There are actually several reasons for this. I don't know about yours, but on my keyboard, all of the alpha keys are labeled with upper case letters. That is, I press the Ctrl and T keys to get the ASCII value 0x24, not the Ctrl and t keys. Original ASCII, from whence these names derived, only had lowercase, uppercase, and control. Ctrl-A was unambiguous, because there was no code for Ctrl-Shift-A. The Ctrl+T spelling was also mandated by the old Windows User Interface Style Guide. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Wed May 28 22:13:06 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Wed, 28 May 2008 21:13:06 +0100 Subject: [python-win32] Docs & bonus: pywin32 docs In-Reply-To: <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> References: <483C2D16.4040707@timgolden.me.uk> <57124720805271010i31bf2600ie5a3eba295d3f3b1@mail.gmail.com> Message-ID: <483DBCD2.1080802@timgolden.me.uk> Simon Dahlbacka wrote: > Very nice, however you might want to fix the code samples to be properly > indented instead of collapsed whitespace.. Thanks to those who pointed out errors in the code samples. Since all I've done is to extract the HTML in the compiled help file, I've fixed those indent issues which were the result of my over-zealous stripping, but any errors which were dodgy markup in the original or invalid links, I've simply left as-is. I *do* hope to get the time to let the upstream developers know, but I don't really want to get into micro-surgery at this point, since I'm effectively post-processing every page of the extracted .chm and there are >5,500 of them! I've reuploaded the pywin32 docs and I hope they continue to be useful, but the real effort is going into the main python-on-windows docs. Thanks to everyone who's contributed to the discussion. Even the sideshows like spacing issues do throw light on different people's concerns. You can't please all the people all the time, but I'll do my best to at least please some of them. [ Currently being worked on: http://timgolden.me.uk/python-on-windows/programming-areas/security.html ] TJG From waldemar.osuch at gmail.com Wed May 28 22:25:39 2008 From: waldemar.osuch at gmail.com (Waldemar Osuch) Date: Wed, 28 May 2008 14:25:39 -0600 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: References: <483C6502.6070001@timgolden.me.uk> Message-ID: <6fae95540805281325m34080aa4u88837fe8297f908@mail.gmail.com> > > 2) use some python libraries (libxml2, libxslt) to transform the xml to > html. That part works but now how to I make a pdf from the html file? > I would use lxml for the transformation and wx for printing. The example below will prompt you with the dialog but it should be possible to silence it somehow. Instead of Acrobat Printer I would use PDFCreator. It is free and one of the myriad options is to automatically save without prompting for a file name. For example: 8<------------------------------------------------------------------------------ import wx from wx import html import lxml.etree as ET def get_reports(): xmlfile = 'report.xml' xslfile = 'style.xsl' for i in range(3): transform = ET.XSLT(ET.parse(xslfile)) result = transform(ET.parse(xmlfile)) yield ET.tostring(result) class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None) self.prn = html.HtmlEasyPrinting() but = wx.Button(self, label='Go') self.Bind(wx.EVT_BUTTON, self.PrintReports) def PrintReports(self, evt): for rpt in get_reports(): self.prn.PrintText(rpt) if __name__ == '__main__': app = wx.PySimpleApp() frame = MyFrame() frame.Show(True) app.MainLoop() From Ron.Henderson at dreamworks.com Wed May 28 22:49:43 2008 From: Ron.Henderson at dreamworks.com (Ron Henderson) Date: Wed, 28 May 2008 13:49:43 -0700 Subject: [python-win32] MSProject and export maps In-Reply-To: <483D189C.7060002@timgolden.me.uk> References: <483683F5.5030901@timgolden.me.uk> <4836C330.2030503@timgolden.me.uk> <483C7862.70705@dreamworks.com> <483D189C.7060002@timgolden.me.uk> Message-ID: <483DC567.5010101@anim.dreamworks.com> Tim Golden wrote: > Ron Henderson wrote: > >> Thanks so much for trying this out. You've verified that it's >> possible to get this working. >> >> However, when I execute the same code, the file "p2.csv" is exactly >> same size as p1.mpp and contains binary data, not the text. Since you >> have it working it must be a bug in either my version of MSProject or >> win32com. I'm using: > We're using identical versions of Python and win32com > (BTW Office Project Standard 2003 11.0.2003.0816.15) I'm using a slightly different (but nominally more recent) version of Project: Office Project Professional 2003 (11.3.2007.1529.15) SP3 > Also, and please don't take this the wrong way, could you post > a screen dump of your interpreter window, showing the (equivalent) > code *and the output file*. Absolutely. This has got to be either something silly that I'm doing or some software glitch in my version of Project or Windows. Here the screen dump from my session (I named the input and output files to match yours): Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import win32com.client >>> >>> project = win32com.client.Dispatch ("MSProject.Application") >>> project.FileOpen ("c:/temp/p1.mpp") True >>> >>> FILENAME = "c:/temp/p2.csv" >>> project.FileSaveAs (Name=FILENAME, FormatID="MSProject.CSV", Map="p1") True >>> >>> project.FileClose (Save=0) True >>> project.FileQuit () True >>> >>> print open (FILENAME).read () ?????? I'm not sure how those binary characters will be handled by my email client, but essentially the file "p2.csv" seems to have been written out as a binary project file, not as a CSV file. If I open the file "p2.csv" in Project using "All Files" in the open dialog, it loads as an exact copy of the original "p1.mpp". Thanks for your help. I'm really baffled as to why this isn't working. From timr at probo.com Wed May 28 23:00:22 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 28 May 2008 14:00:22 -0700 Subject: [python-win32] MSProject and export maps In-Reply-To: <483DC567.5010101@anim.dreamworks.com> References: <483683F5.5030901@timgolden.me.uk> <4836C330.2030503@timgolden.me.uk> <483C7862.70705@dreamworks.com> <483D189C.7060002@timgolden.me.uk> <483DC567.5010101@anim.dreamworks.com> Message-ID: <483DC7E6.2010408@probo.com> Ron Henderson wrote: > > > ... > >>> print open (FILENAME).read () > ?????? > > > I'm not sure how those binary characters will be handled by my email > client, but essentially the file "p2.csv" seems to have been written > out as a binary project file, not as a CSV file. If I open the file > "p2.csv" in Project using "All Files" in the open dialog, it loads as > an exact copy of the original "p1.mpp". Yes. For whatever it's worth, those first 4 characters have the hex values D0 CF 11 E0, which is a hex pseudo-representation of the word "DOCFILE". This is the standard signature for a COM "structure storage document", which is the binary format used by all of the Microsoft Office programs prior to Office 2007. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From bgailer at gmail.com Wed May 28 22:53:11 2008 From: bgailer at gmail.com (bob gailer) Date: Wed, 28 May 2008 16:53:11 -0400 Subject: [python-win32] Concerns with PythonWin documentation In-Reply-To: <483DAF6E.4030407@probo.com> References: <483DAC8C.7000309@gmail.com> <483DAF6E.4030407@probo.com> Message-ID: <483DC637.70303@gmail.com> Tim Roberts wrote: > bob gailer wrote: >> A few years ago I wrote on this subject and never had a response. >> Since Tim has put the docs on the Web I revisited them. And I still >> have questions and concerns. So here goes: >> ... >> Under Keyboard Bindings: >> ... >> Why is Ctrl+ followed by upper case letters when one must use the >> lower case equivalent? > > There are actually several reasons for this. > > I don't know about yours, but on my keyboard, all of the alpha keys > are labeled with upper case letters. That is, I press the Ctrl and T > keys to get the ASCII value 0x24, not the Ctrl and t keys. > > Original ASCII, from whence these names derived, only had lowercase, > uppercase, and control. Ctrl-A was unambiguous, because there was no > code for Ctrl-Shift-A. > > The Ctrl+T spelling was also mandated by the old Windows User > Interface Style Guide. Thanks Tim. I thought I had removed comments anent that after figuring out what you just said. -- Bob Gailer 919-636-4239 Chapel Hill, NC From mhammond at skippinet.com.au Thu May 29 01:33:05 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Thu, 29 May 2008 09:33:05 +1000 Subject: [python-win32] Concerns with PythonWin documentation In-Reply-To: <483DAC8C.7000309@gmail.com> References: <483DAC8C.7000309@gmail.com> Message-ID: <00b801c8c11b$302a1080$907e3180$@com.au> If you can make some edits which reflect your concerns I would be happy to thrash out the detail - eg, you could restructure things, and leave explicit questions where you feel the current docs don't cover the info. That would make my task much simpler and achievable, but also ensure that you aren't again relying on *my* best attempts at this, which really isn't going to be that great. To paraphrase a .sig that Aahz is fond of: the best way to get correct documententation would be to submit patches to the docs that includes wrong information ;) Cheers, Mark > -----Original Message----- > From: python-win32-bounces at python.org [mailto:python-win32- > bounces at python.org] On Behalf Of bob gailer > Sent: Thursday, 29 May 2008 5:04 AM > To: Python-Win32 List > Subject: [python-win32] Concerns with PythonWin documentation > > A few years ago I wrote on this subject and never had a response. Since > Tim has put the docs on the Web I revisited them. And I still have > questions and concerns. So here goes: > > Under Keyboard Bindings: > What does "Common Keystrokes" mean? > What does "Builtin Keystrokes" mean? How are they different from Common > Keystrokes? > How does mention of Scintilla help me understand or use PyWin in this > document? > Why is Ctrl+ followed by upper case letters when one must use the lower > case equivalent? > Ctrl+T says Transpose (swap) the current line with the line above but > it > really is <>. > > Regarding the default configuration file: > > There is a lot of inconsistency (and therefore confusion) in the use > of > the word Shift. > > It is claimed that extensive comments help me create my own > customization. > However the comments do not help me understand the syntax or meaning of > the right side of the = > Why are some words inside << >> and others not? > Where are these words defined? Are there others available? Can we > "roll" > our own? > For example: what is <> What does it mean? What does it do? > Up = <> > Does Up refer to the uparrow? What is the significance of binding it to > <>? It seems to me that would cancel any other > use > of that key. Or is this an additive thing? > > I am vary lost when looking at the function defs starting with > AddBanner. I can guess some of what's going on but feel helpless about > writing my own with success. > > Please consider adding explanations for these things so I (and a lot of > others) could have more confidence. For example I'd really like to have > a key to "Transpose (swap) the current line with the line above". I'd > be > glad to write my own if I knew how to. > > Also where is Ctrl+d documented? It seems to duplicate the current > line! > Are there other undocumented useful key bindings? > > > -- > Bob Gailer > 919-636-4239 Chapel Hill, NC > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From bgailer at gmail.com Thu May 29 03:49:19 2008 From: bgailer at gmail.com (bob gailer) Date: Wed, 28 May 2008 21:49:19 -0400 Subject: [python-win32] Concerns with PythonWin documentation In-Reply-To: <00b801c8c11b$302a1080$907e3180$@com.au> References: <483DAC8C.7000309@gmail.com> <00b801c8c11b$302a1080$907e3180$@com.au> Message-ID: <483E0B9F.4020803@gmail.com> Mark Hammond wrote: > If you can make some edits which reflect your concerns I would be happy to > thrash out the detail - eg, you could restructure things, and leave explicit > questions where you feel the current docs don't cover the info. Will do as best as I can. > That would make my task much simpler and achievable, but also ensure that you aren't > again relying on *my* best attempts at this, which really isn't going to be that great. > > To paraphrase a .sig that Aahz is fond of: the best way to get correct documententation would be to submit patches to the docs that includes wrong information ;) > > Cheers, > > Mark > -- Bob Gailer 919-636-4239 Chapel Hill, NC From ri at eeda.denso.co.jp Thu May 29 07:15:14 2008 From: ri at eeda.denso.co.jp (ri at eeda.denso.co.jp) Date: Thu, 29 May 2008 14:15:14 +0900 Subject: [python-win32] How to get all the variables in a python shell Message-ID: <1D61C8BB5122A54798F01ABBFC3E613D071F239F@eed8s05.eeda.denso.co.jp> Hi! I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the workspace. You double click the icon of the item, and you see its value. You can modify the value of the list item, 1 -> 100 etc, after which if you go back to the command window and type 'a' and press enter, you see that varable a's value has been changed to 100. So my question is : if you have two DOS command windows running under WINDOWS OS, how can you make them share the same internal variable buffer? Or is there any easier way to implemente such kind of interaction? I'm looking forward to your answers. Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Thu May 29 10:18:19 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 29 May 2008 09:18:19 +0100 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: References: Message-ID: <483E66CB.1010003@timgolden.me.uk> lixinyi.23 at gmail.com wrote: > I'm currently working on a scientific computation software built in > python. > What I want to implement is a Matlab style command window <-> > workspace interaction. > > For example, you type 'a=1' in the command window, and you see a list > item named 'a' in the workspace. > You double click the icon of the item, and you see its value. You can > modify the value of the list item, > 1 -> 100 etc, after which if you go back to the command window and > type 'a' and press enter, you see that > varable a's value has been changed to 100. > > So my question is : if you have two DOS command windows running under > WINDOWS OS, how can you make them share the same internal variable > buffer? Or is there any easier way to implement such kind of > interaction? I stronly suggest you look at IPython [1]. To do what I think you're describing, you'd need to hack or reimplement the interpreter. And that's what they've done. ISTR that they even have a branch which is dealing with parallel instances. TJG [1] http://ipython.scipy.org/moin/ From mail at timgolden.me.uk Thu May 29 10:10:51 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 29 May 2008 09:10:51 +0100 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: References: Message-ID: <483E650B.5060902@timgolden.me.uk> lixinyi.23 at gmail.com wrote: > I'm currently working on a scientific computation software built in > python. > What I want to implement is a Matlab style command window <-> > workspace interaction. > > For example, you type 'a=1' in the command window, and you see a list > item named 'a' in the workspace. > You double click the icon of the item, and you see its value. You can > modify the value of the list item, > 1 -> 100 etc, after which if you go back to the command window and > type 'a' and press enter, you see that > varable a's value has been changed to 100. > > So my question is : if you have two DOS command windows running under > WINDOWS OS, how can you make them share the same internal variable > buffer? Or is there any easier way to implement such kind of > interaction? I stronly suggest you look at IPython [1]. To do what I think you're describing, you'd need to hack or reimplement the interpreter. And that's what they've done. ISTR that they even have a branch which is dealing with parallel instances. TJG [1] http://ipython.scipy.org/moin/ From rdahlstrom at directedge.com Thu May 29 13:03:40 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Thu, 29 May 2008 07:03:40 -0400 Subject: [python-win32] How to get all the variables in a python shell References: <483E650B.5060902@timgolden.me.uk> Message-ID: -----Original Message----- > From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Tim Golden > Sent: Thursday, May 29, 2008 4:11 AM > To: Python-Win32 List; python-list at python.org > Cc: Python-Win32 List > Subject: Re: [python-win32] How to get all the variables in a python shell > > lixinyi.23 at gmail.com wrote: > > I'm currently working on a scientific computation software built in > > python. > > What I want to implement is a Matlab style command window <-> > > workspace interaction. > > > > For example, you type 'a=1' in the command window, and you see a list > > item named 'a' in the workspace. > > You double click the icon of the item, and you see its value. You can > > modify the value of the list item, > > 1 -> 100 etc, after which if you go back to the command window and > > type 'a' and press enter, you see that > > varable a's value has been changed to 100. > > > > So my question is : if you have two DOS command windows running under > > WINDOWS OS, how can you make them share the same internal variable > > buffer? Or is there any easier way to implement such kind of > > interaction? > > I stronly suggest you look at IPython [1]. To do what I think > you're describing, you'd need to hack or reimplement the interpreter. > And that's what they've done. ISTR that they even have a branch > which is dealing with parallel instances. > > TJG > > [1] http://ipython.scipy.org/moin/ > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 I'd try looking at memcached (http://www.danga.com/memcached/apis.html). No hacking or reimplementation of the interpreter would be necessary, and there's a Python api available. I haven't used it for anything production related, but I have played with it a bit, and it's fast and stable. DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com From p.f.moore at gmail.com Thu May 29 13:22:45 2008 From: p.f.moore at gmail.com (Paul Moore) Date: Thu, 29 May 2008 12:22:45 +0100 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: References: <483E650B.5060902@timgolden.me.uk> Message-ID: <79990c6b0805290422g5b61f3c5l65034ee6e5798178@mail.gmail.com> On 29/05/2008, Dahlstrom, Roger wrote: > I'd try looking at memcached (http://www.danga.com/memcached/apis.html). > No hacking or reimplementation of the interpreter would be necessary, and > there's a Python api available. I haven't used it for anything production related, > but I have played with it a bit, and it's fast and stable. Is memcached available for Windows, then? I've heard nice things about it, but thought it was Unix-only. Paul. From rdahlstrom at directedge.com Thu May 29 13:23:45 2008 From: rdahlstrom at directedge.com (Dahlstrom, Roger) Date: Thu, 29 May 2008 07:23:45 -0400 Subject: [python-win32] How to get all the variables in a python shell References: <483E650B.5060902@timgolden.me.uk> <79990c6b0805290422g5b61f3c5l65034ee6e5798178@mail.gmail.com> Message-ID: -----Original Message----- From: Paul Moore [mailto:p.f.moore at gmail.com] Sent: Thursday, May 29, 2008 7:23 AM To: Dahlstrom, Roger Cc: Python-Win32 List; python-list at python.org Subject: Re: [python-win32] How to get all the variables in a python shell On 29/05/2008, Dahlstrom, Roger wrote: > I'd try looking at memcached (http://www.danga.com/memcached/apis.html). > No hacking or reimplementation of the interpreter would be necessary, and > there's a Python api available. I haven't used it for anything production related, > but I have played with it a bit, and it's fast and stable. Is memcached available for Windows, then? I've heard nice things about it, but thought it was Unix-only. Paul. ---------------------------- It is available for Windows, yes. As a matter of fact, I've never used it on Unix. DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications. www.directedge.com From mcpacino at gmail.com Thu May 29 10:38:16 2008 From: mcpacino at gmail.com (McPacino) Date: Thu, 29 May 2008 16:38:16 +0800 Subject: [python-win32] how to change paper size while printing Message-ID: <62fa579f0805290138s391bb1c5ia7c4d140858ec192@mail.gmail.com> I have a network printer. the default paper size is A4. I have tried 2 ways to change the paper size: 1) p = win32print.OpenPrinter(dp) t = win32print.GetPrinter(p, 2) t['pDevMode'].FormName=u'a3' win32print.SetPrinter(p, 2, t, 0) these code cause error refuse access, which maybe because of it's network printer 2) I get a DEVMODE (dmo) struct by calling win32print.DocumentProperties(0, p, dp, dmo, dmo, win32con.DM_IN_BUFFER|win32con.DM_OUT_BUFFER), but I have no idea to apply the DEVMODE to my DC. ( use resetDC()? it seems that no resetDC in python) anybody can give me some hint or sample code? thanks a lot. McPacino -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Thu May 29 14:00:59 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 29 May 2008 13:00:59 +0100 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: <483E650B.5060902@timgolden.me.uk> References: <483E650B.5060902@timgolden.me.uk> Message-ID: <483E9AFB.2040402@timgolden.me.uk> Tim Golden wrote: > lixinyi.23 at gmail.com wrote: >> I'm currently working on a scientific computation software built in >> python. >> What I want to implement is a Matlab style command window <-> >> workspace interaction. >> >> For example, you type 'a=1' in the command window, and you see a list >> item named 'a' in the workspace. >> You double click the icon of the item, and you see its value. You can >> modify the value of the list item, >> 1 -> 100 etc, after which if you go back to the command window and >> type 'a' and press enter, you see that >> varable a's value has been changed to 100. >> >> So my question is : if you have two DOS command windows running under >> WINDOWS OS, how can you make them share the same internal variable >> buffer? Or is there any easier way to implement such kind of >> interaction? > > I stronly suggest you look at IPython [1]. To do what I think > you're describing, you'd need to hack or reimplement the interpreter. > And that's what they've done. ISTR that they even have a branch > which is dealing with parallel instances. Sorry, having seen Roger D's memcached suggestion, I realise I may have misinterpreted your requirement. I thought that you wanted a Python interpreter session to share its objects to another window, hence my IPython suggestion. If you're writing your own console app and want to share stuff, then there's any number of IPC possibilities. Roger's already mentioned memcached which I've no more than a passing knowledge of. But Pyro [1] is often a good bet for these things, and the pyprocessing [2] module is gaining a fair bit of traction at the moment. (To name just two out of many). TJG [1] http://pyro.sf.net [2] http://pyprocessing.berlios.de/ From mail at timgolden.me.uk Thu May 29 14:12:32 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 29 May 2008 13:12:32 +0100 Subject: [python-win32] MSProject and export maps In-Reply-To: <483DC567.5010101@anim.dreamworks.com> References: <483683F5.5030901@timgolden.me.uk> <4836C330.2030503@timgolden.me.uk> <483C7862.70705@dreamworks.com> <483D189C.7060002@timgolden.me.uk> <483DC567.5010101@anim.dreamworks.com> Message-ID: <483E9DB0.5070703@timgolden.me.uk> Ron Henderson wrote: > Tim Golden wrote: > >> Ron Henderson wrote: >> >>> Thanks so much for trying this out. You've verified that it's >>> possible to get this working. >>> >>> However, when I execute the same code, the file "p2.csv" is exactly >>> same size as p1.mpp and contains binary data, not the text. Since you >>> have it working it must be a bug in either my version of MSProject or >>> win32com. Sorry: flummoxed. I can't see it being the cause, but could you dip into the generated Python module (from gen_py) and pick out the SaveAs function and post it up here. Maybe the signature will give some clues, if it seems to have swapped things around or whatever? (Clutching-at-Straws) TJG From mail at timgolden.me.uk Thu May 29 14:00:59 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 29 May 2008 13:00:59 +0100 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: <483E650B.5060902@timgolden.me.uk> References: <483E650B.5060902@timgolden.me.uk> Message-ID: <483E9AFB.2040402@timgolden.me.uk> <<< No Message Collected >>> From mail at timgolden.me.uk Thu May 29 15:38:56 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 29 May 2008 14:38:56 +0100 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: <483E650B.5060902@timgolden.me.uk> References: <483E650B.5060902@timgolden.me.uk> Message-ID: <483EB1F0.70502@timgolden.me.uk> [Bizarrely, my mail system seems to be randomly misfiring. If you've already seen this, please ignore!] Tim Golden wrote: Sorry, having seen Roger D's memcached suggestion, I realise I may have misinterpreted your requirement. I thought that you wanted a Python interpreter session to share its objects to another window, hence my IPython suggestion. If you're writing your own console app and want to share stuff, then there's any number of IPC possibilities. Roger's already mentioned memcached which I've no more than a passing knowledge of. But Pyro [1] is often a good bet for these things, and the pyprocessing [2] module is gaining a fair bit of traction at the moment. (To name just two out of many). TJG [1] http://pyro.sf.net [2] http://pyprocessing.berlios.de/ From Kyle.Rickey at bakerhughes.com Thu May 29 15:26:36 2008 From: Kyle.Rickey at bakerhughes.com (Rickey, Kyle W) Date: Thu, 29 May 2008 08:26:36 -0500 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: <6fae95540805281325m34080aa4u88837fe8297f908@mail.gmail.com> References: <483C6502.6070001@timgolden.me.uk> <6fae95540805281325m34080aa4u88837fe8297f908@mail.gmail.com> Message-ID: <6DF913F6ABC69E45836DE3E02551A7F0072737@MSGHOUMBX07.ent.bhicorp.com> Thanks, I got your example working but unfortunately the results didn't work good. Here's links to 2 pictures for comparison, sensitive information removed. http://www.dsrt.org-a.googlepages.com/bad_report.png http://www.dsrt.org-a.googlepages.com/good_report.png It wouldn't let me attach the images because the message was over 30 KB. Let me give a little more background on the process. Our software generates reports as xml files that use xsl transformation. The xsl files are in a separate directory from the xml reports. The pink boxes in the bad picture are supposed to be bmp files from another directory. The xml references 1 xsl which in turn does includes on multiple xsl files. Lastly, the 'Page n of nn' is the page numbering system. Once the page loads in IE or FF a javascript function gets called to number the pages. Are my efforts futile? Or am I missing something simple? -Kyle Rickey -----Original Message----- From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Waldemar Osuch Sent: Wednesday, May 28, 2008 3:26 PM To: python-win32 at python.org Subject: Re: [python-win32] Dispatch InternetExplorer.Application fails > > 2) use some python libraries (libxml2, libxslt) to transform the xml to > html. That part works but now how to I make a pdf from the html file? > I would use lxml for the transformation and wx for printing. The example below will prompt you with the dialog but it should be possible to silence it somehow. Instead of Acrobat Printer I would use PDFCreator. It is free and one of the myriad options is to automatically save without prompting for a file name. For example: 8<---------------------------------------------------------------------- -------- import wx from wx import html import lxml.etree as ET def get_reports(): xmlfile = 'report.xml' xslfile = 'style.xsl' for i in range(3): transform = ET.XSLT(ET.parse(xslfile)) result = transform(ET.parse(xmlfile)) yield ET.tostring(result) class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None) self.prn = html.HtmlEasyPrinting() but = wx.Button(self, label='Go') self.Bind(wx.EVT_BUTTON, self.PrintReports) def PrintReports(self, evt): for rpt in get_reports(): self.prn.PrintText(rpt) if __name__ == '__main__': app = wx.PySimpleApp() frame = MyFrame() frame.Show(True) app.MainLoop() _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 From mdriscoll at co.marshall.ia.us Thu May 29 16:08:16 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Thu, 29 May 2008 09:08:16 -0500 Subject: [python-win32] How to get all the variables in a python shell In-Reply-To: <1D61C8BB5122A54798F01ABBFC3E613D071F239F@eed8s05.eeda.denso.co.jp> References: <1D61C8BB5122A54798F01ABBFC3E613D071F239F@eed8s05.eeda.denso.co.jp> Message-ID: <483EB8D0.8070705@co.marshall.ia.us> > Hi! > I'm currently working on a scientific computation software built in > python. > What I want to implement is a Matlab style command window <-> > workspace interaction. > For example, you type 'a=1' in the command window, and you see a list > item named 'a' in the workspace. > You double click the icon of the item, and you see its value. You can > modify the value of the list item, > 1 -> 100 etc, after which if you go back to the command window and > type 'a' and press enter, you see that > varable a's value has been changed to 100. > So my question is : if you have two DOS command windows running under > WINDOWS OS, how can you make > them share the same internal variable buffer? Or is there any easier > way to implemente such kind of interaction? > I'm looking forward to your answers. Thanks in advance! You might ask at the matplotlib user's group: http://sourceforge.net/mail/?group_id=80706 Also, I know a few of the regulars on the wxPython list use matplotlib in their projects, so if you want a GUI instead, you might ask there too. http://wxpython.org/maillist.php ------------------- Mike Driscoll Python Extension Building Network: http:\\www.pythonlibrary.org Blog: http:\\blog.pythonlibrary.org From waldemar.osuch at gmail.com Thu May 29 18:16:11 2008 From: waldemar.osuch at gmail.com (Waldemar Osuch) Date: Thu, 29 May 2008 10:16:11 -0600 Subject: [python-win32] Dispatch InternetExplorer.Application fails In-Reply-To: <6DF913F6ABC69E45836DE3E02551A7F0072737@MSGHOUMBX07.ent.bhicorp.com> References: <483C6502.6070001@timgolden.me.uk> <6fae95540805281325m34080aa4u88837fe8297f908@mail.gmail.com> <6DF913F6ABC69E45836DE3E02551A7F0072737@MSGHOUMBX07.ent.bhicorp.com> Message-ID: <6fae95540805290916m37d1cd1egbca3ca09b521dc00@mail.gmail.com> On Thu, May 29, 2008 at 7:26 AM, Rickey, Kyle W wrote: > Thanks, I got your example working but unfortunately the results didn't > work good. Here's links to 2 pictures for comparison, sensitive > information removed. > > http://www.dsrt.org-a.googlepages.com/bad_report.png > http://www.dsrt.org-a.googlepages.com/good_report.png > Judging by the output it looks that some of the stylesheet paths are not resolved correctly. Why is it so? I do not know. In my testing lxml was handling xsl:includes correctly. > > Let me give a little more background on the process. Our software > generates reports as xml files that use xsl transformation. The xsl > files are in a separate directory from the xml reports. The pink boxes > in the bad picture are supposed to be bmp files from another directory. > The xml references 1 xsl which in turn does includes on multiple xsl > files. > > Lastly, the 'Page n of nn' is the page numbering system. Once the page > loads in IE or FF a javascript function gets called to number the pages. > > Are my efforts futile? Or am I missing something simple? It is up to your boss to decide if your efforts are futile. I can not comment on that. :-) If lxml does not work for you use something else to produce the output Microsoft MSXML is not a bad choice. Then if you have some custom javascript involved, your original idea to use InternetExplorer may be the best. From larry.bates at websafe.com Fri May 30 03:35:04 2008 From: larry.bates at websafe.com (Larry Bates) Date: Thu, 29 May 2008 20:35:04 -0500 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: Tim Golden wrote: > I have a request of the python-win32 community. Have a look at: > > http://timgolden.me.uk/python-on-windows/ > > In particular, click through to the section on the Registry (which is > the only section which has anything useful in it!) > and then tell me what you think. About anything. The contents, > the style, the colours, the colors, the depth of examples, the > notes. What should be there? What shouldn't? How much overlap > there should be with other sources of documentation? How much > should just be links across? Should I reproduce the pywin32 docs > verbatim. (Difficult: I've got a branch which is trying. Very trying). > Anything. > > Points to bear in mind: > > * This is very alpha > * I'm using Sphinx but I've done very little with its capabilities > * The examples I've put together work: you can drop them straight onto > an interpreter window and run them. But is that a desirable goal. > * My intention is that this be a community effort. (The source is actually > hosted at Google Code). > * This URL (probably) won't be its final resting place. > > In particular, it will be very clear as you read that I'm 100% sure > where I'm going with it yet. But at the very least I want lots of > examples which, even in passing, semi-document the kind of stuff which > people ask about > on python-win32 and python-list. > > Enough babble from me. Have a look. > > TJG Tim, On my monitors the blue links look "fuzzy". Table of contents blue on blue is hard for me to read. While I'm not crazy about the pink background, that is probably a personal preference. -Larry Bates (Windows XP Pro, running dual monitors at 1600 x 1200). From rwupole at msn.com Fri May 30 06:15:53 2008 From: rwupole at msn.com (Roger Upole) Date: Fri, 30 May 2008 00:15:53 -0400 Subject: [python-win32] how to change paper size while printing Message-ID: McPacino wrote: > I have a network printer. the default paper size is A4. > I have tried 2 ways to change the paper size: > > 1) > p = win32print.OpenPrinter(dp) > t = win32print.GetPrinter(p, 2) > t['pDevMode'].FormName=u'a3' > win32print.SetPrinter(p, 2, t, 0) > > these code cause error refuse access, which maybe because of it's network > printer > The default access for OpenPrinter isn't enough to set the form. Try win32print.OpenPrinter(dp, {'DesiredAccess':win32print.PRINTER_ALL_ACCESS}) Roger From siddhartha.veedaluru at gmail.com Fri May 30 08:19:00 2008 From: siddhartha.veedaluru at gmail.com (siddhartha veedaluru) Date: Fri, 30 May 2008 11:49:00 +0530 Subject: [python-win32] Error while listing the Installed Software using wmi module Message-ID: <424b71ec0805292319q13476619q39d81c30762a66f@mail.gmail.com> Hi all, The following code snippet gives the error import wmi c = wmi.WMI() for i in c.Win32_Product(): print i.Name Output ----------- Windows Installer Clean Up Python 2.5.1 Debugging Tools for Windows Windows Resource Kit Tools Adobe Reader 8.1.2 Java(TM) SE Runtime Environment 6 Java(TM) 6 Update 3 Traceback (most recent call last): File "C:\PyWork\test8.py", line 4, in print i.Name File "C:\Python25\lib\encodings\cp437.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\xae' in position 5: character maps to regards, Siddhartha -------------- next part -------------- An HTML attachment was scrubbed... URL: From ton.vanvliet at skynet.be Fri May 30 09:42:46 2008 From: ton.vanvliet at skynet.be (Ton van Vliet) Date: Fri, 30 May 2008 09:42:46 +0200 Subject: [python-win32] Request for comments In-Reply-To: <48359D9B.7040109@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> Message-ID: On Thu, 22 May 2008 17:21:47 +0100, you wrote: >I have a request of the python-win32 community. Have a look at: > >http://timgolden.me.uk/python-on-windows/ > >In particular, click through to the section on the Registry >(which is the only section which has anything useful in it!) >and then tell me what you think. About anything. The contents, >the style, the colours, the colors, the depth of examples, the >notes. What should be there? What shouldn't? How much overlap >there should be with other sources of documentation? How much >should just be links across? Should I reproduce the pywin32 docs >verbatim. (Difficult: I've got a branch which is trying. Very trying). >Anything. > >Points to bear in mind: > > * This is very alpha > * I'm using Sphinx but I've done very little with its capabilities > * The examples I've put together work: you can drop them straight >onto an interpreter window and run them. But is that a desirable goal. > * My intention is that this be a community effort. (The source is actually >hosted at Google Code). > * This URL (probably) won't be its final resting place. > >In particular, it will be very clear as you read that I'm 100% sure where >I'm going with it yet. But at the very least I want lots of examples which, >even in passing, semi-document the kind of stuff which people ask about >on python-win32 and python-list. > >Enough babble from me. Have a look. > >TJG > Tim, IMHO the links could be a bit more visible. When looking at the 'Where do I begin' paragraph, it took me quite some time to notice that there *were* actually links in there (after being taken there by clicking on the 'Where do I begin' link in the left hand column already several times) Using Opera and FF on W2K at 1600x1200 Looking forward to using the contents. Ton. From mail at timgolden.me.uk Fri May 30 10:10:51 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 30 May 2008 09:10:51 +0100 Subject: [python-win32] Request for comments In-Reply-To: References: <48359D9B.7040109@timgolden.me.uk> Message-ID: <483FB68B.9060709@timgolden.me.uk> [Ton van Vliet] > IMHO the links could be a bit more visible. > > When looking at the 'Where do I begin' paragraph, it took me quite some > time to notice that there *were* actually links in there (after being > taken there by clicking on the 'Where do I begin' link in the left hand > column already several times) > > Using Opera and FF on W2K at 1600x1200 [Larry Bates] > On my monitors the blue links look "fuzzy". > Table of contents blue on blue is hard for me to read. > While I'm not crazy about the pink background, that is > probably a personal preference. > (Windows XP Pro, running dual monitors at 1600 x 1200). Thanks, Larry and Ton. FWIW, my visual design skills are pretty much nil. The best I can hope for is "clean and workmanlike". I inherited most of the Sphinx default styles (including that red-on-pink for the warning) and adjusted a few, not least to make a clear distinction from the official Python docs. For now, I've modifed the styles to something a little more bland, using the conventional blue for links and a mild grey for the sidebar. I've left the red-on-pink, partly because it only appears for warnings and if it jars a bit, well that's probably not a bad thing in the circs. While I do want the appearance to be both attractive and readable, I'm trying to avoid spending too much time poking at RGB codes in the hope of achieving Visual Nirvana :) The front page is in one way the most important page and I'm not at all sure I've got it right yet. (Suggestions will be appreciated). But for now, my focus is getting content in, without which the front page is so much vapourware. Thanks v. much for the input. Keep it coming. TJG From mail at timgolden.me.uk Fri May 30 10:32:37 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 30 May 2008 09:32:37 +0100 Subject: [python-win32] Error while listing the Installed Software using wmi module In-Reply-To: <424b71ec0805292319q13476619q39d81c30762a66f@mail.gmail.com> References: <424b71ec0805292319q13476619q39d81c30762a66f@mail.gmail.com> Message-ID: <483FBBA5.8000105@timgolden.me.uk> siddhartha veedaluru wrote: > Hi all, > > The following code snippet gives the error > import wmi > c = wmi.WMI() > for i in c.Win32_Product(): > print i.Name WMI returns the Name as a unicode object. You usually need to encode that one way or another to print it out / save it to a file, etc. Try this: import wmi c = wmi.WMI () for i in c.Win32_Product (): print i.Name.encode (sys.stdout.encoding, "replace") TJG From hanni.ali at gmail.com Fri May 30 15:00:28 2008 From: hanni.ali at gmail.com (Hanni Ali) Date: Fri, 30 May 2008 14:00:28 +0100 Subject: [python-win32] building pywin32 on Server 2003 x64 Message-ID: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> Hi All, I am attempting to build pywin32 for a 64 bit deployment. It is necessary for us to use 64 bit python due to objects within our application exceeding 2GB in size. I am attempting to do so using msvc 2005 which I know is not ideal, but I have managed to build the other dependencies (Python, numpy), my attention is now on pywin32. Firstly although I have managed to get it compiling, I was not able to use the instruction: setup.py build --plat-name=win-amd64 The setup script reported plat-name as not existing. Secondly is anyone building pywin32 on 64 bit machines? Although I seem to have hacked it suficiently to get it to compile linking fails with errors of this manner: MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_Get CurrentThreadId referenced in function __security_init_cookie I appreciate any help anyone can give. Thanks Hanni -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdriscoll at co.marshall.ia.us Fri May 30 16:54:02 2008 From: mdriscoll at co.marshall.ia.us (Mike Driscoll) Date: Fri, 30 May 2008 09:54:02 -0500 Subject: [python-win32] Request for comments In-Reply-To: <483FB68B.9060709@timgolden.me.uk> References: <48359D9B.7040109@timgolden.me.uk> <483FB68B.9060709@timgolden.me.uk> Message-ID: <4840150A.3010100@co.marshall.ia.us> Tim Golden wrote: >
[Ton van > Vliet] >> IMHO the links could be a bit more visible. >> >> When looking at the 'Where do I begin' paragraph, it took me quite >> some time to notice that there *were* actually links in there (after >> being taken there by clicking on the 'Where do I begin' link in the >> left hand column already several times) >> >> Using Opera and FF on W2K at 1600x1200 > > [Larry Bates] >> On my monitors the blue links look "fuzzy". >> Table of contents blue on blue is hard for me to read. >> While I'm not crazy about the pink background, that is probably a >> personal preference. >> (Windows XP Pro, running dual monitors at 1600 x 1200). > > Thanks, Larry and Ton. FWIW, my visual design skills are pretty > much nil. The best I can hope for is "clean and workmanlike". I > inherited most of the Sphinx default styles (including > that red-on-pink for the warning) and adjusted a few, not least > to make a clear distinction from the official Python docs. > > For now, I've modifed the styles to something a little more bland, > using the conventional blue for links and a mild grey for the sidebar. > I've left the red-on-pink, partly because it only appears for warnings > and if it jars a bit, well that's probably not a bad thing in the circs. > While I do want the appearance to be both attractive and readable, > I'm trying to avoid spending too much time poking at RGB codes in > the hope of achieving Visual Nirvana :) > > The front page is in one way the most important page and I'm not > at all sure I've got it right yet. (Suggestions will be appreciated). But > for now, my focus is getting content in, without which the front page > is so much vapourware. > > Thanks v. much for the input. Keep it coming. > > TJG > >
Tim, I was looking at the front page and thought it might be nice to have a section devoted to Networking / Remote Access. Or maybe that's rolled into one of the other categories and I missed it. In the "building and deploying" section, I see you have MinGW. I have a generic tutorial on how to compile extensions using that compiler that you're welcome to use and/or re-work for your site. You can find it here: http://pythonlibrary.org/mingw.htm If you need help, let me know. I have a similar one for VS2003, but it's much rougher (http://pythonlibrary.org/visual_studio.htm). Also, there's a cool wrapper for py2exe called GUI2exe that makes using it much easier (at least for me): http://xoomer.alice.it/infinity77/main/GUI2Exe.html Mike From timr at probo.com Fri May 30 19:38:12 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 30 May 2008 10:38:12 -0700 Subject: [python-win32] building pywin32 on Server 2003 x64 In-Reply-To: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> References: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> Message-ID: <48403B84.7000108@probo.com> Hanni Ali wrote: > > I am attempting to build pywin32 for a 64 bit deployment. Wow, that's a big task. I hope you will be able to share what you learn with Mark. Many people will be interested in this in the future. Mark will have to decide whether the 64-bit version will need to be called "pywin64"... > Although I seem to have hacked it suficiently to get it to compile > linking fails with errors of this manner: > > MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol > __imp_Get > CurrentThreadId referenced in function __security_init_cookie In my experience, this usually indicates a mismatch between compiler versions, where some of the object or libraries were compiled with a different compiler. Are you using the "amd64" libraries to link this? Have you downloaded a platform SDK, or are you using the one that ships with VS2005? Are you compiling ON a Win64 system, or are you cross-compiling? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mail at timgolden.me.uk Fri May 30 21:55:56 2008 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 30 May 2008 20:55:56 +0100 Subject: [python-win32] Request for comments In-Reply-To: <4840150A.3010100@co.marshall.ia.us> References: <48359D9B.7040109@timgolden.me.uk> <483FB68B.9060709@timgolden.me.uk> <4840150A.3010100@co.marshall.ia.us> Message-ID: <48405BCC.1040205@timgolden.me.uk> Mike Driscoll wrote: > I was looking at the front page and thought it might be nice to have a > section devoted to Networking / Remote Access. Or maybe that's rolled > into one of the other categories and I missed it. Sounds good. > In the "building and deploying" section, I see you have MinGW. I have a > generic tutorial on how to compile extensions using that compiler that > you're welcome to use and/or re-work for your site. You can find it > here: http://pythonlibrary.org/mingw.htm If you need help, let me know. It would be great if you could just reverse-engineer it into a Sphinx page. I can move it around to meet my layout, such as it is, but a ReST-format text would get things going all the sooner. > I have a similar one for VS2003, but it's much rougher > (http://pythonlibrary.org/visual_studio.htm). > > Also, there's a cool wrapper for py2exe called GUI2exe that makes using > it much easier (at least for me): > http://xoomer.alice.it/infinity77/main/GUI2Exe.html Thanks for all those. Very obviously (I hope) whatever categories and still-to-come topics in there at present by no means represent some kind of BDUF structure. They're pretty much the result of me brainstorming on the Tube into work. (Which is where most of the content is being written at the mo). TJG From mhammond at skippinet.com.au Sat May 31 00:37:40 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sat, 31 May 2008 08:37:40 +1000 Subject: [python-win32] building pywin32 on Server 2003 x64 In-Reply-To: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> References: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> Message-ID: <02d701c8c2a5$c722fb10$5568f130$@com.au> pywin32 builds on a 64bit environment, but you need the SVN trunk of Python, the CVS trunk of pywin32, and VS2008. VS2005 support isn't *that* interesting to me as there are no Python binaries available built with that compiler and I can't get VS.NET to build with the most recent Vista SDK, which is needed for recent pywin32 functionality. A Python 2.6 amd64 build will be included in the next release. Cheers, Mark From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Hanni Ali Sent: Friday, 30 May 2008 11:00 PM To: python-win32 at python.org Subject: [python-win32] building pywin32 on Server 2003 x64 Hi All, I am attempting to build pywin32 for a 64 bit deployment. It is necessary for us to use 64 bit python due to objects within our application exceeding 2GB in size. I am attempting to do so using msvc 2005 which I know is not ideal, but I have managed to build the other dependencies (Python, numpy), my attention is now on pywin32. Firstly although I have managed to get it compiling, I was not able to use the instruction: setup.py build --plat-name=win-amd64 The setup script reported plat-name as not existing. Secondly is anyone building pywin32 on 64 bit machines? Although I seem to have hacked it suficiently to get it to compile linking fails with errors of this manner: MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_Get CurrentThreadId referenced in function __security_init_cookie I appreciate any help anyone can give. Thanks Hanni -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksandrv at berkeley.edu Sat May 31 01:57:40 2008 From: aleksandrv at berkeley.edu (Aleksandr VLADIMIRSKIY) Date: Fri, 30 May 2008 16:57:40 -0700 Subject: [python-win32] Exception setting a string using COM Message-ID: <7918C1A70119A34887246E1DEC04C65302A7B27A@coemailsrv.coe.berkeley.edu> Hello, I'm attempting to set a string value using a COM interface to an application. I get the following traceback. Could anyone help me understand the nature of the error or how I might begin to discover it? Thank you, Aleksandr Code and traceback: In [2]: from win32com.client import Dispatch In [3]: eApp = Dispatch("ExpressionMedia.Application") In [4]: catalog = eApp.ActiveCatalog In [5]: selection = catalog.Selection In [6]: item = selection[0] In [7]: path = item.Path In [8]: path Out[8]: u'E:\\Images\\Events\\Alumni and Student\\BEIA formerly DEAA\\2008\\Awards dinner CD 01\\DSC_0009.JPG' In [9]: path = "" In [10]: path Out[10]: '' In [11]: item.Path = "" --------------------------------------------------------------------------- pywintypes.com_error Traceback (most recent call last) C:\ c:\python24\lib\site-packages\win32com\client\__init__.py in __setattr__(self, attr, value) 461 except KeyError: 462 raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr) --> 463 self._oleobj_.Invoke(*(args + (value,) + defArgs)) 464 def _get_good_single_object_(self, obj, obUserName=None, resultCLSID=None): 465 return _get_good_single_object_(obj, obUserName, resultCLSID) com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None) In [12]: From timr at probo.com Sat May 31 02:31:15 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 30 May 2008 17:31:15 -0700 Subject: [python-win32] Exception setting a string using COM In-Reply-To: <7918C1A70119A34887246E1DEC04C65302A7B27A@coemailsrv.coe.berkeley.edu> References: <7918C1A70119A34887246E1DEC04C65302A7B27A@coemailsrv.coe.berkeley.edu> Message-ID: <48409C53.8020205@probo.com> Aleksandr VLADIMIRSKIY wrote: > I'm attempting to set a string value using a COM interface to an application. I get the following traceback. Could anyone help me understand the nature of the error or how I might begin to discover it? > ... > > In [11]: item.Path = "" > --------------------------------------------------------------------------- > pywintypes.com_error Traceback (most recent call last) > > C:\ > > c:\python24\lib\site-packages\win32com\client\__init__.py in __setattr__(self, attr, value) > 461 except KeyError: > 462 raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr) > --> 463 self._oleobj_.Invoke(*(args + (value,) + defArgs)) > 464 def _get_good_single_object_(self, obj, obUserName=None, resultCLSID=None): > 465 return _get_good_single_object_(obj, obUserName, resultCLSID) > > com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None) > -2147467259 is 80004005, which is the rather unhelpful E_FAIL. Sometimes, when it is mapping a settable/gettable property, the Python COM mapper creates a separate method for setting. You might try: item.setPath( "" ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From mbelzile at softimage.com Sat May 31 05:02:59 2008 From: mbelzile at softimage.com (=?iso-8859-1?Q?Marc-Andr=E9_Belzile?=) Date: Fri, 30 May 2008 23:02:59 -0400 Subject: [python-win32] building pywin32 on Server 2003 x64 In-Reply-To: <02d701c8c2a5$c722fb10$5568f130$@com.au> References: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> <02d701c8c2a5$c722fb10$5568f130$@com.au> Message-ID: <0BCB4AE868D8934A8B3DCE3A58126A89022AF3A7@tewk-mbpf3> Meanwhile, if you're still up to the challenge, here are the steps I used for building pywin32 for vista 64: 1) svn co http://svn.python.org/projects/python/trunk python 2) compile python 2.6 for x64 from VS2008 IDE or Windows SDK 3) open x64 command-prompt 4) log as anonymous to pywin32 server: cvs -d:pserver:anonymous at pywin32.cvs.sourceforge.net:/cvsroot/pywin32 login 5) download latest pywin32 source: cvs -z3 -d:pserver:anonymous at pywin32.cvs.sourceforge.net:/cvsroot/pywin32 co -P pywin32 6) c:\dev\pywin32>\build ..\python2.6\python\PCbuild\python.exe setup.py build --plat-name=win-amd64 7) c:\dev\pywin32>\build ..\python2.6\python\PCbuild\python.exe setup.py bdist_wininst --skip-build The pywin32 install package should be generated here c:\dev\pywin32>\build\dist\pywin32-210.9.win32.exe Hope that helps -mab ________________________________ From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Mark Hammond Sent: May-30-08 6:38 PM To: 'Hanni Ali'; python-win32 at python.org Subject: Re: [python-win32] building pywin32 on Server 2003 x64 pywin32 builds on a 64bit environment, but you need the SVN trunk of Python, the CVS trunk of pywin32, and VS2008. VS2005 support isn't *that* interesting to me as there are no Python binaries available built with that compiler and I can't get VS.NET to build with the most recent Vista SDK, which is needed for recent pywin32 functionality. A Python 2.6 amd64 build will be included in the next release. Cheers, Mark From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Hanni Ali Sent: Friday, 30 May 2008 11:00 PM To: python-win32 at python.org Subject: [python-win32] building pywin32 on Server 2003 x64 Hi All, I am attempting to build pywin32 for a 64 bit deployment. It is necessary for us to use 64 bit python due to objects within our application exceeding 2GB in size. I am attempting to do so using msvc 2005 which I know is not ideal, but I have managed to build the other dependencies (Python, numpy), my attention is now on pywin32. Firstly although I have managed to get it compiling, I was not able to use the instruction: setup.py build --plat-name=win-amd64 The setup script reported plat-name as not existing. Secondly is anyone building pywin32 on 64 bit machines? Although I seem to have hacked it suficiently to get it to compile linking fails with errors of this manner: MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_Get CurrentThreadId referenced in function __security_init_cookie I appreciate any help anyone can give. Thanks Hanni -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Sat May 31 08:13:27 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sat, 31 May 2008 16:13:27 +1000 Subject: [python-win32] building pywin32 on Server 2003 x64 In-Reply-To: <0BCB4AE868D8934A8B3DCE3A58126A89022AF3A7@tewk-mbpf3> References: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> <02d701c8c2a5$c722fb10$5568f130$@com.au> <0BCB4AE868D8934A8B3DCE3A58126A89022AF3A7@tewk-mbpf3> Message-ID: <002f01c8c2e5$754ab9f0$5fe02dd0$@com.au> There is a buglet in bdist_wininst and --skip-build - note that the filename created by your process doesn't have "py2.6" included in the filename. To fix that, the final command should also include "--target-version=2.6" Cheers, Mark From: Marc-Andr? Belzile [mailto:mbelzile at softimage.com] Sent: Saturday, 31 May 2008 1:03 PM To: Mark Hammond; Hanni Ali; python-win32 at python.org Subject: RE: [python-win32] building pywin32 on Server 2003 x64 Meanwhile, if you're still up to the challenge, here are the steps I used for building pywin32 for vista 64: 1) svn co http://svn.python.org/projects/python/trunk python 2) compile python 2.6 for x64 from VS2008 IDE or Windows SDK 3) open x64 command-prompt 4) log as anonymous to pywin32 server: cvs -d:pserver:anonymous at pywin32.cvs.sourceforge.net:/cvsroot/pywin32 login 5) download latest pywin32 source: cvs -z3 -d:pserver:anonymous at pywin32.cvs.sourceforge.net:/cvsroot/pywin32 co -P pywin32 6) c:\dev\pywin32>\build ..\python2.6\python\PCbuild\python.exe setup.py build --plat-name=win-amd64 7) c:\dev\pywin32>\build ..\python2.6\python\PCbuild\python.exe setup.py bdist_wininst --skip-build The pywin32 install package should be generated here c:\dev\pywin32>\build\dist\pywin32-210.9.win32.exe Hope that helps -mab _____ From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Mark Hammond Sent: May-30-08 6:38 PM To: 'Hanni Ali'; python-win32 at python.org Subject: Re: [python-win32] building pywin32 on Server 2003 x64 pywin32 builds on a 64bit environment, but you need the SVN trunk of Python, the CVS trunk of pywin32, and VS2008. VS2005 support isn't *that* interesting to me as there are no Python binaries available built with that compiler and I can't get VS.NET to build with the most recent Vista SDK, which is needed for recent pywin32 functionality. A Python 2.6 amd64 build will be included in the next release. Cheers, Mark From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org] On Behalf Of Hanni Ali Sent: Friday, 30 May 2008 11:00 PM To: python-win32 at python.org Subject: [python-win32] building pywin32 on Server 2003 x64 Hi All, I am attempting to build pywin32 for a 64 bit deployment. It is necessary for us to use 64 bit python due to objects within our application exceeding 2GB in size. I am attempting to do so using msvc 2005 which I know is not ideal, but I have managed to build the other dependencies (Python, numpy), my attention is now on pywin32. Firstly although I have managed to get it compiling, I was not able to use the instruction: setup.py build --plat-name=win-amd64 The setup script reported plat-name as not existing. Secondly is anyone building pywin32 on 64 bit machines? Although I seem to have hacked it suficiently to get it to compile linking fails with errors of this manner: MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_Get CurrentThreadId referenced in function __security_init_cookie I appreciate any help anyone can give. Thanks Hanni -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Sat May 31 09:18:42 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sat, 31 May 2008 17:18:42 +1000 Subject: [python-win32] pywin32 build 211 released Message-ID: <003b01c8c2ee$8ec50260$ac4f0720$@com.au> Hi all, I've finally released pywin32 build 211! These days, it almost goes without saying that Roger Upole again contributed significant changes, and various other people also contributed bits and pieces - the full change notes are at: https://sourceforge.net/project/shownotes.php?release_id=603349 Given there have been a large number of changes since the last release, I recommend you exercise caution before upgrading production systems; however, this release has been extensively tested recently, so I don't anticipate any problems. Get it now via https://sourceforge.net/project/showfiles.php?group_id=78018 Cheers, Mark From hanni.ali at gmail.com Sat May 31 10:37:01 2008 From: hanni.ali at gmail.com (Hanni Ali) Date: Sat, 31 May 2008 09:37:01 +0100 Subject: [python-win32] building pywin32 on Server 2003 x64 In-Reply-To: <002f01c8c2e5$754ab9f0$5fe02dd0$@com.au> References: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> <02d701c8c2a5$c722fb10$5568f130$@com.au> <0BCB4AE868D8934A8B3DCE3A58126A89022AF3A7@tewk-mbpf3> <002f01c8c2e5$754ab9f0$5fe02dd0$@com.au> Message-ID: <789d27b10805310137j48c7dcefr8b7d103ce88833c8@mail.gmail.com> Thanks for some of the advice, A little background so my questions make sense. This deployment is for a mission critical application. I am migrating it from python-2.4 to 2.5 also changing the code which uses numarray/numeric to use numpy which is one of the main parts of the move (I thought), this is necessary as python > 2.5 uses numpy instead. This also should allow us to manipulate objects over 2GB, I believe this would only be on 64bit platforms though hence my need for 64 bit. Firstly, I am currently using VS2005 as I am compiling Python-2.5.2 because I was going for the most stable python. Everyone here seems to think I should be using 2.6, as far as I can tell this is still in alpha and I am not convinced of the wisdom of using an alpha testing system for production. Secondly we don't have 2008 yet in my organisation and the express edition doesn't contain the 64 bit compiler. All my development is on a 64bit system (I am not cross compiling). I have been using the SDK for server 2003. If I manage to sort this out anything I have I will be sure to share. However although I have managed to coax subversion to download through our firewall I have not yet managed to get CVS to do so and have been downloading CVS at home on my linux machine and e-mailing it in (not ideal!). What do people think of python 2.6 on windows? is it ready? I note the first beta should be out on the 4th June, this might be more reasonable. I don't think I could sell "let's use this alpha version in production" to anyone ;) Thanks, Hanni 2008/5/31 Mark Hammond : > There is a buglet in bdist_wininst and --skip-build - note that the > filename created by your process doesn't have "py2.6" included in the > filename. To fix that, the final command should also include > "--target-version=2.6" > > > > Cheers, > > > > Mark > > > > *From:* Marc-Andr? Belzile [mailto:mbelzile at softimage.com] > *Sent:* Saturday, 31 May 2008 1:03 PM > *To:* Mark Hammond; Hanni Ali; python-win32 at python.org > *Subject:* RE: [python-win32] building pywin32 on Server 2003 x64 > > > > Meanwhile, if you're still up to the challenge, here are the steps I used > for building pywin32 for vista 64: > > > > 1) svn co http://svn.python.org/projects/python/trunk python > 2) compile python 2.6 for x64 from VS2008 IDE or Windows SDK > 3) open x64 command-prompt > 4) log as anonymous to pywin32 server: cvs > -d:pserver:anonymous at pywin32.cvs.sourceforge.net:/cvsroot/pywin32 login > 5) download latest pywin32 source: cvs -z3 > -d:pserver:anonymous at pywin32.cvs.sourceforge.net:/cvsroot/pywin32 co -P > pywin32 > 6) c:\dev\pywin32>\build ..\python2.6\python\PCbuild\python.exe setup.py > build --plat-name=win-amd64 > 7) c:\dev\pywin32>\build ..\python2.6\python\PCbuild\python.exe setup.py > bdist_wininst --skip-build > > > The pywin32 install package should be generated here > c:\dev\pywin32>\build\dist\pywin32-210.9.win32.exe > > > > Hope that helps > > > > -mab > > > > > ------------------------------ > > *From:* python-win32-bounces at python.org [mailto: > python-win32-bounces at python.org] *On Behalf Of *Mark Hammond > *Sent:* May-30-08 6:38 PM > *To:* 'Hanni Ali'; python-win32 at python.org > *Subject:* Re: [python-win32] building pywin32 on Server 2003 x64 > > pywin32 builds on a 64bit environment, but you need the SVN trunk of > Python, the CVS trunk of pywin32, and VS2008. VS2005 support isn't *that* > interesting to me as there are no Python binaries available built with that > compiler and I can't get VS.NET to build with the most recent Vista SDK, > which is needed for recent pywin32 functionality. A Python 2.6 amd64 build > will be included in the next release. > > > > Cheers, > > > > Mark > > > > *From:* python-win32-bounces at python.org [mailto: > python-win32-bounces at python.org] *On Behalf Of *Hanni Ali > *Sent:* Friday, 30 May 2008 11:00 PM > *To:* python-win32 at python.org > *Subject:* [python-win32] building pywin32 on Server 2003 x64 > > > > Hi All, > > > > I am attempting to build pywin32 for a 64 bit deployment. > > > > It is necessary for us to use 64 bit python due to objects within our > application exceeding 2GB in size. > > > > I am attempting to do so using msvc 2005 which I know is not ideal, but I > have managed to build the other dependencies (Python, numpy), my attention > is now on pywin32. > > > > Firstly although I have managed to get it compiling, I was not able to use > the instruction: > > > > setup.py build --plat-name=win-amd64 > > > > The setup script reported plat-name as not existing. > > > > Secondly is anyone building pywin32 on 64 bit machines? > > > > Although I seem to have hacked it suficiently to get it to compile linking > fails with errors of this manner: > > > > MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol > __imp_Get > CurrentThreadId referenced in function __security_init_cookie > > > > I appreciate any help anyone can give. > > > > Thanks > > > > Hanni > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mc at mclaveau.com Sat May 31 10:39:39 2008 From: mc at mclaveau.com (Michel Claveau) Date: Sat, 31 May 2008 10:39:39 +0200 Subject: [python-win32] pywin32 build 211 released In-Reply-To: <003b01c8c2ee$8ec50260$ac4f0720$@com.au> References: <003b01c8c2ee$8ec50260$ac4f0720$@com.au> Message-ID: Hi! > I've finally released pywin32 build 211! Super mega very great new! To celebrate that, I invite you to aperitif, today, at midday. It's here: http://maps.google.com/?ie=UTF8&om=1&ll=44.384614,4.639181&spn=0.013801,0.045877&t=h&z=15at very soon;o)Michel Claveau From mhammond at skippinet.com.au Sat May 31 13:23:02 2008 From: mhammond at skippinet.com.au (Mark Hammond) Date: Sat, 31 May 2008 21:23:02 +1000 Subject: [python-win32] building pywin32 on Server 2003 x64 In-Reply-To: <789d27b10805310137j48c7dcefr8b7d103ce88833c8@mail.gmail.com> References: <789d27b10805300600p24997328x737b8a831361f179@mail.gmail.com> <02d701c8c2a5$c722fb10$5568f130$@com.au> <0BCB4AE868D8934A8B3DCE3A58126A89022AF3A7@tewk-mbpf3> <002f01c8c2e5$754ab9f0$5fe02dd0$@com.au> <789d27b10805310137j48c7dcefr8b7d103ce88833c8@mail.gmail.com> Message-ID: <005601c8c310$b23fd540$16bf7fc0$@com.au> > Firstly, I am currently using VS2005 as I am compiling Python-2.5.2 because > I was going for the most stable python. Everyone here seems to think I should > be using 2.6, as far as I can tell this is still in alpha and I am not convinced > of the wisdom of using an alpha testing system for production. Secondly we don't > have 2008 yet in my organisation and the express edition doesn't contain the 64 > bit compiler. I can sympathize - but the reality is that so far, it has been too hard for me to support 64bit builds using the latest Vista features using VS.NET. No Python version has been released that uses VS2005, so that's not a priority - although if people would like to contribute patches so people who do need this can build it, I'd be happy to accept them. > All my development is on a 64bit system (I am not cross compiling). I have been Pedantic side-note: best I can tell, all the compilers are x86 binaries, so even on a 64bit OS, we are still cross-compiling :) > using the SDK for server 2003. If I manage to sort this out anything I have I > will be sure to share. However although I have managed to coax subversion to > download through our firewall I have not yet managed to get CVS to do so and > have been downloading CVS at home on my linux machine and e-mailing it in (not ideal!). Grab the source .zip for build 211 now it is fresh, but otherwise, a work around would be to update CVS from home, then run "setup.py sdist" and move the resulting .zip file to work. > What do people think of python 2.6 on windows? is it ready? It's in pretty good shape IMO. > I note the first beta should be out on the 4th June, this might be more reasonable. > I don't think I could sell "let's use this alpha version in production" to anyone ;) I agree for 32bit builds, but IMO the 64 bit builds are somewhat different - the lack of 64bit binaries for most python 2.5 extensions implies to me that x64 on 2.6 isn't any risker; particularly when talking about 2.5 builds using an "unsupported" compiler. From pywin32's POV, I'm quite certain more people are testing x64 using 2.6 builds than 2.5. Cheers, Mark From bgailer at gmail.com Sat May 31 15:57:19 2008 From: bgailer at gmail.com (bob gailer) Date: Sat, 31 May 2008 09:57:19 -0400 Subject: [python-win32] pywin32 build 211 released In-Reply-To: <003b01c8c2ee$8ec50260$ac4f0720$@com.au> References: <003b01c8c2ee$8ec50260$ac4f0720$@com.au> Message-ID: <4841593F.7040401@gmail.com> Mark Hammond wrote: > Hi all, > I've finally released pywin32 build 211! > > These days, it almost goes without saying that Roger Upole again contributed > significant changes, and various other people also contributed bits and > pieces - the full change notes are at: > https://sourceforge.net/project/shownotes.php?release_id=603349 I just ran the installer. Under Help - About it claims to be build 210.9! The interactive window starts out: PythonWin 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> Pythonwin.exe File Version is 2.5.211.0 What's wrong? -- Bob Gailer 919-636-4239 Chapel Hill, NC