Re: [python-win32] GetModuleFileName requires Process or Thread handle?

2008-08-12 Thread Tim Golden
Walter Decker wrote: Can someone help me diagnose why the following fails to retrieve the 'exe' name KillByName? Do you mind if I sidestep your question altogether and point out that this is one of those things which WMI makes a fair bit easier? Obviously, if what you want is an insight into Wi

Re: [python-win32] help with parsing email

2008-08-14 Thread Tim Golden
Ahmed, Shakir wrote: I need to grab/parse numeric numbers such as app number from incoming emails stored in Microsoft Outlook (Microsoft Exchange server) with specified subject line. The email body is like this myregion ; tst ; 11-Aug-2008 http://my.xyz.com//content/ifs/apps/myDocFo

Re: [python-win32] Accessing properties of share on DFS

2008-08-27 Thread Tim Golden
Michael Kesper wrote: Until now I'm using win32net.NetSessionEnum to list sessions users have open. Now homes will be migrated to Distributed Filesystem (DFS). As far as I understood msdn I should access that via win32wnet. But now, I have some troubles to figure out how this really works. The fo

Re: [python-win32] How can I use GetKeyboardLayout in python?

2008-08-27 Thread Tim Golden
Dror Cohen wrote: Hi everybody, for a long time I'm trying to get my current typing language in windows. At the moment I'm thinking about using either GetKeyboardLayout or ITfInputProcessorProfiles that holds the **GetCurrentLanguage*

Re: [python-win32] Accessing properties of share on DFS

2008-09-01 Thread Tim Golden
Michael Kesper wrote: Hi, * Tim Golden <[EMAIL PROTECTED]> [2008-08-27 14:35:37 +0100]: You might be able to get there with WMI. The following works on my own machine, but I'm not sure what machine you'd need to access to list the DFS shares. I'll see if I can persuade

Re: [python-win32] Internet Explorer constants

2008-09-05 Thread Tim Golden
Gabriel Genellina wrote: Hello I want to control Internet Explorer. This is what I have so far: import win32com.client from win32com.client.gencache import EnsureDispatch url = "..." IE = EnsureDispatch("InternetExplorer.Application") IE.Navigate(url) IE.Visible = 1 It works fine and shows the

Re: [python-win32] Handling COM events in a python thread

2008-09-05 Thread Tim Golden
Ujjaval Suthar wrote: Hi all, I have a COM control which fires a status event called ProcessingDataAvailable(). The COM control has a method call AddData() with some data parameters. Using python, in a simple program, I can instantiate COM object via Dispatch and call AddData() method succe

Re: [python-win32] how to obtain list of connected IP/port pairs on user's computer?

2008-09-08 Thread Tim Golden
Patrick Li wrote: I'm interested in writing a function that returns me the list of IP/port that the user's machine is connected to. The most naive way is to run netstat -na on the user's computer and just parse the stdout. Are there libraries I can call to achieve this as opposed to running a

Re: [python-win32] Adding an exe to startup...

2008-09-16 Thread Tim Golden
John Bunting wrote: I've been having some trouble finding information on how to add an exe that I have created to the startup of my windows box. I would like to know how I should go about adding the exe to the startup menu, without using the gui interface. I want to be able to automate this b

Re: [python-win32] Win32 Python Extensions Outlook.Application Question

2008-09-17 Thread Tim Golden
Pramod Vaidyanathan wrote: The problem comes down to this. I have an email that I have received in Microsoft Outlook that contains characters outside of the ascii set. I was able to use your library to traverse through my outlook folders and select the appropriate emails etc. There are chara

Re: [python-win32] Win32 Python Extensions Outlook.ApplicationQuestion

2008-09-17 Thread Tim Golden
Vaidyanathan, Pramod wrote: Thanks Tim, Unfortunately my resutls are still as follows. I still have question mark characters. Is it possibly a microsoft outlook versioning issue? u' \xbe \xbc \xbd \xbd \xbd \xbd\r\n\xbe \xbc \xbd \xbd \xbd \xbd \xbd\r\n\xbe \xbc\r\n\xbe \xbc \r\n \r\n? \r\n?

Re: [python-win32] Win32 Python ExtensionsOutlook.ApplicationQuestion

2008-09-17 Thread Tim Golden
Vaidyanathan, Pramod wrote: Yes, Print repr (message.Body) I am using Microsoft Outlook (2000). Are you using outlook 2003 by chance? Yep. I just discovered that when I do the exact same thing in Outlook 2003, the problem disappears. I believe it's some sort of settings issue in my versi

Re: [python-win32] Drag and drop of files (CF_HDROP)

2008-09-21 Thread Tim Golden
mir amicitas wrote: I have been trying to implement drag and drop of files in python. My application will written in PyQt4 but they I want to use the native drag and drop for windows as PyQt only supports mime based dragging, which does not work for some of the windows applications that I want t

Re: [python-win32] idle detection on system?

2008-09-23 Thread Tim Golden
Patrick Li wrote: Hi, Does anyone know how I can detect if a system is idle? By idle I am referring to a user being away from the computer (no keyboard or mouse movement) for X minutes. Tried searching around but I haven't found anything that mentions how I can hook into these two events. I

Re: [python-win32] Invalid or corrupted installer...

2008-09-23 Thread Tim Golden
Andrea Gavana wrote: Hi All, I am having few problems in downloading and installing the release 212 of PyWin32 (and all the other releases as well) from SourceForge. Whatever executable file I try to download from SourceForge (I need the pywin32-212.win32-py2.5.exe for my Python version), th

Re: [python-win32] Invalid or corrupted installer...

2008-09-23 Thread Tim Golden
Andrea Gavana wrote: ... No explanation was provided for the reason of the corrupted download (!) There used to be a general warning on sites which offered tgz for download that IE would do something weird with them. I never experienced the problem myself, and in any case that was years (and v

Re: [python-win32] Virtual print driver - similiar to winpdf

2008-09-23 Thread Tim Golden
geoff wrote: You might take a look at Pyla. It's a print to fax library. I think it's kind of what you're talking about. I've been trying to hack it off and on for a while now as we only need a little of its functionality here at work. There isn't much for docs, so you'll have to read the source.

Re: [python-win32] NT service and login prompt

2008-10-01 Thread Tim Golden
Larry Bates wrote: le dahut wrote: Hello, Is it possible to tell windows to wait a python service has started before the login prompt is displayed ? Probably not, but why would you want to implement something that does? Share your use case with us and perhaps we can be of more assistance.

Re: [python-win32] NT service and login prompt

2008-10-01 Thread Tim Golden
le dahut wrote: Yes, I was trying to intercept user's logon. I've done it using userinit registry key, a python NT service and a python service running on the PDC. My problem is also that the service has to be available at logon time to do some administrative stuff. It seems that the policy

Re: [python-win32] How to determine if a process (known pid) is still running ?

2008-10-05 Thread Tim Golden
Stef Mientki wrote: How to determine if a process (known pid) os still running ? Googling the web, I found 1 solution in killing the process, but that's not what I want, I want to reuse the running process. I could also ask a complete list of active processes, but from my experiences that's qui

Re: [python-win32] Problem in accessing the Message body of Outlook Inbox.

2008-10-09 Thread Tim Golden
venu madhav wrote: Hi all, How can I access the body of a mail in Outlook Inbox? I tried various options like message.Body or message.Mesg etc. but didn't work. I could get the subject of the mail using message.Subject though. If you haven't already, check out this page, which will get

Re: [python-win32] NT service and login prompt

2008-10-09 Thread Tim Golden
le dahut wrote: I've put a loop that wait for the service to be up with win32serviceutil.WaitForServiceStatus. Makes sense. Thanks for getting back. TJG ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/py

Re: [python-win32] NT service and login prompt

2008-10-10 Thread Tim Golden
le dahut wrote: I've put a loop that wait for the service to be up with win32serviceutil.WaitForServiceStatus. Tim Golden a écrit : le dahut wrote: Yes, I was trying to intercept user's logon. I've done it using userinit registry key, a python NT service and a python serv

Re: [python-win32] Interacting with the desktop as a service on Vista

2008-10-22 Thread Tim Golden
Matt Herbert (matherbe) wrote: So I have a service that needs to interact with the desktop on a Vista machine. I've read multiple articles about Vista's updated security and it's restrictions on services. So I realize that in order for the service to interact with desktop, I'm going to need to cr

Re: [python-win32] force outlook ui update

2008-10-29 Thread Tim Golden
Christan K. wrote: Tim Roberts probo.com> writes: Christian K. wrote: the subject field in the inbox list changes immedately but the subject line of the message itself (either shown in the embedded panel or in its own frame) does not. After a couple of other actions, i.e. selecting and desle

Re: [python-win32] win32com and DispatchWithEvents()

2008-11-15 Thread Tim Golden
Thomas Heller wrote: Ryan Neve schrieb: I posted this on comp.lang.python. but it has been pointed out to me that this is a better place to ask. I'm trying to get DispatchWithEvents() to work with HyperAccess (terminal program) without much success. My apologies for (again) advertising comty

Re: [python-win32] turning monitors off from Python?

2008-12-04 Thread Tim Golden
Alec Bennett wrote: I'm trying to turn a monitor off from a Python script. I can do this using the program "wizmo", so its possible from Windows. I found this script which describes a method using SendMessage: http://fci-h.blogspot.com/2007/03/turn-off-your-monitor-via-code-c.html Translated

Re: [python-win32] rebooting windows from Python?

2008-12-05 Thread Tim Golden
Tim Roberts wrote: Alec Bennett wrote: I'm wondering if there's some way to reboot or shutdown Windows from within Python? I can log out like this: win32api.ExitWindowsEx(4) And according to the documentation, I should be able to shutdown like this: win32api.ExitWindowsEx(2) But that retur

Re: [python-win32] Walking the registry and creating reg files

2008-12-05 Thread Tim Golden
Mike Driscoll wrote: We're doing what amounts to a registry session audit here at work, so I need to walk a specific set of subfolders in our registry and get the contents thereof. The subfolders will vary from user to user. I found Tim Golden's excellent registry walking script on his website

Re: [python-win32] rebooting windows from Python?

2008-12-05 Thread Tim Golden
Alec Bennett wrote: import wmi wmi.WMI(privileges=["Shutdown"]).Win32_OperatingSystem()[0].Shutdown () Stylin, works. The only thing it doesn't do that I personally need it to do is the "force shutdown". In other words "shutdown.exe -f". I found this page with some hints but couldn't get

Re: [python-win32] Walking the registry and creating reg files

2008-12-05 Thread Tim Golden
Mike Driscoll wrote: Tim Roberts wrote: Mike Driscoll wrote: We're doing what amounts to a registry session audit here at work, so I need to walk a specific set of subfolders in our registry and get the contents thereof. The subfolders will vary from user to user. I found Tim Golden's excelle

Re: [python-win32] Walking the registry and creating reg files

2008-12-05 Thread Tim Golden
Dahlstrom, Roger wrote: If you can read the registry, you can save it without any other special permissions. It is just text. Just export a branch of your own registry and open it with notepad to see the format. I do it all the time, it works fine. You're quite right, Roger, and other peop

Re: [python-win32] Getting active SMTP servers via python.

2008-12-10 Thread Tim Golden
Dominick Lauzon wrote: I am attempting to determine the accessible SMTP servers on a given desktop to avoir various users for having to predefine in a given script to facilitate distribution. Can you clarify what you mean by "the accessible SMTP servers"? If you're connected to the internet,

[python-win32] Passing data in a windows message

2008-12-10 Thread Tim Golden
I'm using win32gui.PyGetBufferAddressAndLen to pass the address & length of a marshalled object as the wparam / lparam of a windows message. Something like this: address, length = \ win32gui.PyGetBufferAddressAndLen (buffer (marshal.dumps (message))) PostMessage (self.hwnd, self.WM_PROGRESS_ME

Re: [python-win32] Passing data in a windows message

2008-12-10 Thread Tim Golden
Tim Roberts wrote: Thomas Heller wrote: Since you used PostMessage, the message is simply posted to the thread's message queue. You have no control when it is processed; so I fear you must keep the posted 'object' alive even longer. This is a good point that I overlooked. If you used SendM

Re: [python-win32] Writing to Excel performance

2008-12-12 Thread Tim Golden
Dominick Lauzon wrote: I have large matrices of data to push to excel and I find the writing of data to excel to be excessively slow (cell by cell method) even if the Visible is to False. Right now I reverted back to a 2 step CSV - Import to Excel but it is far from ideal. Is there any t

Re: [python-win32] Detecting fast user switching

2008-12-16 Thread Tim Golden
Arron Chapman - UnkwnDesign.Com wrote: I found Tim Golden's artical "See if my workstation is locked" http://timgolden.me.uk/python/win32_how_do_i/see_if_my_workstation_is_locked.html which got me most of the way to where I need to be, I want to detect both logout and login events I haven't

Re: [python-win32] python.exe crashes while connecting to MSSQL Database using pyodbc.connect

2008-12-17 Thread Tim Golden
siddhartha veedaluru wrote: i have created a System DSN in my local machine using python script which uses ctypes module using pyodbc module i'm trying to connect to remote database. sometimes python.exe crashes in the connect function Not answering your question directly but... did you know

Re: [python-win32] Hello and first question

2008-12-22 Thread Tim Golden
Andrea wrote: Hi folks, I'm new to the list and also to the python word! I want to write a script to exchange messages with a win32 application. I have a sample code in VB but I want to do it using python. The problem is that I have no experience on comunication between application in win. Look

Re: [python-win32] Reading Task Manager-Performance tab values

2009-01-13 Thread Tim Golden
Tony Cappellini wrote: Is there an API for reading the values on the Performance Tab in Task Manager on XP? Without being 100% sure, I would imagine that WMI could pull them out for you. However, there isn't -- afaik -- a "Task Manager API" where you could be guaranteed of getting the selfsame

Re: [python-win32] User transparent authentication with PDC

2009-01-20 Thread Tim Golden
le dahut wrote: Thank you, it looks like something good. But I was not precise enough in my first post, my PDC is a Linux/Samba system. The client/server app I've written uses twisted-perspective broker. I don't trust the client side, so it should send to the server some informations it can c

Re: [python-win32] Windows Service, user activity and timed message box

2009-01-27 Thread Tim Golden
Ferdinand Sousa wrote: Greetings: I wanted some help on the following topics: A] How do I set up a script to run as a service? Are there any prerequisites for this? There are a few recipes in the cookbook. Here's one for starters: http://code.activestate.com/recipes/576450/ B] How do we c

Re: [python-win32] advanced properties file

2009-01-28 Thread Tim Golden
wowberk wrote: Hello everybody, I need to list the advanced properties of a file such as organization, dll version, etc.. I think you want structured storage. Have a look at my winshell module (or at the code it implements): http://timgolden.me.uk/python/winshell.html TJG ___

Re: [python-win32] Windows Service, user activity and timed message box

2009-02-01 Thread Tim Golden
Ferdinand Sousa wrote: I couldn't find the GetLastInputInfo function (pywin32 212, python 2.5.2 on Xp). That's because it's not there . You'd have to use ctypes or roll your own extension for that. What I'm putting together is a script that uses Adobe Acrobat COM. It opens a port and listens

[python-win32] Unexpected feature in win32security?

2009-02-03 Thread Tim Golden
I *think* this is a bug (or at least an unfortunate effect) but I'll post here first for a sanity check. I'm looking at Windows security: descriptors, ACLs, etc. The conventional wisdom is that a DACL (or an SACL but less commonly) can be one of three things within a security descriptor: 1) Not

Re: [python-win32] Unexpected feature in win32security?

2009-02-03 Thread Tim Golden
Roger Upole wrote: Thanks very much for responding to this, Roger. 1) Not there 2) There but NULL 3) There and a (possibly empty) list of ACEs In practice, cases 1 and 2 are functionally identical . Once a security descriptor has been applied to an object, the SE_DACL_PRESENT flag is always

Re: [python-win32] win32file.ReadDirectoryChangesW in asynch mode?

2009-02-05 Thread Tim Golden
Eric Blade wrote: It appears that sometime in the last year, year and a half or so, someone made the necessary changes to win32file to get ReadDirectoryChangesW up and working in Asynch mode, which is something that I would find very nice to be able to use right now .. however, the docs are makin

Re: [python-win32] reliability issues with ReadDirectoryChangesW

2009-02-08 Thread Tim Golden
Eric Blade wrote: I am getting significantly unreliable results using ReadDirectoryChangesW, attempting to use a simplified version of the codes that had been presented to me in my last query for help.. Eric, can you say what results you *are* getting and in what way they're unreliable? I don't

Re: [python-win32] reliability issues with ReadDirectoryChangesW

2009-02-08 Thread Tim Golden
Eric Blade wrote: [... snipped code ...] If it's possible, consider posting to something like pastebin or some other online snippets clipboard so we can see the whole code. It's even more difficult debugging something when you only have half the code! :) TJG

Re: [python-win32] Obtaining Outlook item properties from saved email file

2009-02-16 Thread Tim Golden
Paul Moore wrote: Sorry, this is only peripherally a Python issue, as the code I'm writing could just as easily be VBScript or any other language... But as I'm writing in Python, and this group is full of helpful and knowledgeable people... :-) I have a folder full of emails saved from Outlook (

Re: [python-win32] PyWin 32 variable instead of 'Nothing' in VB

2009-02-16 Thread Tim Golden
Payman Rowhani wrote: We have a Visual Basic script that communicates with an application through com. We like to translate it to Python and use win32com.client instead. We have everything working, except for the use of "Nothing" in the VB script for a couple of its function calls. What is the

Re: [python-win32] OnCtlColor not working?

2009-03-02 Thread Tim Golden
Greg Ewing wrote: Well, it *almost* works now... it's okay for all the button styles except BS_PUSHBUTTON. My OnCtlColor is still getting called, but the pushbutton seems to ignore the results. All the other button styles are okay. Am I still doing something wrong, or is this a known limitation

Re: [python-win32] Question on parsing Reparse Points

2009-03-20 Thread Tim Golden
Philip Bloom wrote: Hello, This is my first post the python win32 programming list, so hello. I'm trying to figure out a way to tell where a Reparse Point () is really pointing programmatically. I can determine pretty easily a folder is a Junction (win32api.GetFileAttributes(folder)==1040), b

Re: [python-win32] how to hibernate from python ? how to detect idleness of the pc ?

2009-03-24 Thread Tim Golden
jo wrote: Hi I would like to automatically hibernate my home pc when my wife has not been using it for say half an hour. Two things I dont know - how to hibernate from python http://mail.python.org/pipermail/python-win32/2008-June/007698.html - how to detect idleness of the pc That's m

Re: [python-win32] How to enumerate com ports?

2009-04-03 Thread Tim Golden
Alec Bennett wrote: I'd like to get a list of available com ports on a Windows machine. I've seen some reference to a function EnumSerialPorts but can't find any documentation. You can get it from WMI via the Win32_SerialPort class TJG ___ python-wi

Re: [python-win32] Move to mercurial?

2009-04-07 Thread Tim Golden
Mark Hammond wrote: I'll cut a long story short and say that given Python has decided to move to Mercurial, I'm more than happy for pywin32 to move to Mercurial too. I'd prefer to avoid having this turn into a debate of the relative merits of the various DVCS systems, but I'd welcome any concern

Re: [python-win32] IronPython in Action Out!

2009-04-11 Thread Tim Golden
Michael Foord wrote: Hello all, *Finally* IronPython in Action is out. This is the first English language book on IronPython and is now in stock with Manning and Amazon.com and on the Safari bookshelf. Excellent news. Must be great to see it in the flesh after so much preparation! I look forw

Re: [python-win32] AddMembershipRule(SMS_CollectionRuleDirect): Generic failure

2009-04-17 Thread Tim Golden
John Randolph wrote: Hi list: I've been beating my head against this problem for 2 days and can't figure it out. Searching the archives produced a semi-relevant thread from the past but the former fixes haven't worked for me. Using wmi 1.3.2, I've got the following simple code: system = w

Re: [python-win32] AddMembershipRule(SMS_CollectionRuleDirect): Generic failure

2009-04-18 Thread Tim Golden
John Randolph wrote: Actually I had previously placed a delay between the new_rule creation and calling AddMembershipRule for another reason -- to make a clear break in the timestamps on the server side wmi logs. Unfortunately the delay doesn't help. Shame. Adding a Put_ gave me a different

Re: [python-win32] problem getting printer status in Windows

2009-04-21 Thread Tim Golden
Alec Bennett wrote: I'm having trouble getting the printer status in Windows. Ideally I'd like to get the info contained in the "Status" column when you open a printer from the Windows control panel --> printers. Generally, altho' not always, questions like this have an answer which starts wit

Re: [python-win32] AddMembershipRule(SMS_CollectionRuleDirect): Generic failure

2009-04-21 Thread Tim Golden
John Randolph wrote: On Sat, Apr 18, 2009 at 8:09 PM, Tim Golden wrote: John Randolph wrote: Actually I had previously placed a delay between the new_rule creation and calling AddMembershipRule for another reason -- to make a clear break in the timestamps on the server side wmi logs

Re: [python-win32] Programatically activating secondary monitor?

2009-04-30 Thread Tim Golden
Alec Bennett wrote: I'm wondering if there's a way to enable a second monitor in Windows from Python or otherwise programatically? Currently I use the utility UltraMon, which works, but it sure would be nice to be able to do this from Python. I'm not quite sure I understand what "enable a seco

Re: [python-win32] gpedit reload method in python

2009-04-30 Thread Tim Golden
le dahut wrote: Hello, "gpedit.msc" can change several parameters in system for example items in start menu or hidden drives in explorer. The changes made in "gpedit" are immediately applied, if you have "My computer" opened you can see selected letters disappear. I know that "gpedit" modifie

Re: [python-win32] Silent installation of pywin32

2009-05-08 Thread Tim Golden
siddhartha veedaluru wrote: Hi all Do we have a way to install pywin32 module silently.? Does the exe which is downloable support silent installation? Don't think so; your best bet is probably to rebuild as an MSI which you can install with a "silent running" mode. TJG ___

Re: [python-win32] AddMembershipRule(SMS_CollectionRuleDirect): Generic failure

2009-05-11 Thread Tim Golden
John Randolph wrote: On Tue, Apr 21, 2009 at 3:52 PM, Tim Golden wrote: Actually I had previously placed a delay between the new_rule creation and calling AddMembershipRule for another reason -- to make a clear break in the timestamps on the server side wmi logs. Unfortunately the delay

Re: [python-win32] Fwd: Autosizing column widths in Excel using win32com.client ?

2009-05-17 Thread Tim Golden
James Matthews wrote: -- Forwarded message -- From: Date: Fri, May 15, 2009 at 7:45 PM Subject: Autosizing column widths in Excel using win32com.client ? To: python-l...@python.org Is there a way to autosize the widths of the excel columns as when you double click them manually

Re: [python-win32] Re ading date from PYTime

2009-05-19 Thread Tim Golden
SantoshMohan wrote: Hi, I am writing a script to read date from xls file. Output is like this: emptylist [((u'Name', u'DOB'),), ((u'C R RAMESH', ),), ((u'G SIVA RAMA KRISHNAIAH', ),)] emptylist[1] ((u'C R RAMESH', ),) value ((u'C R RAMESH', ),) value[0][1] How to read the date and

[python-win32] Distutils changes broke pywin32 build

2009-05-19 Thread Tim Golden
Something in the changes to build_ext.py in r72585 has broken the setup.py build for pywin32: http://svn.python.org/view/python/trunk/Lib/distutils/command/build_ext.py?r1=72531&r2=72585&pathrev=72585 The symptom is that pywintypes.lib is created in the build directory, but distutils is then lo

Re: [python-win32] Distutils changes broke pywin32 build

2009-05-19 Thread Tim Golden
Tim Golden wrote: Something in the changes to build_ext.py in r72585 has broken the setup.py build for pywin32: http://svn.python.org/view/python/trunk/Lib/distutils/command/build_ext.py?r1=72531&r2=72585&pathrev=72585 Well, in short, it's a change in the way in which package

Re: [python-win32] Distutils changes broke pywin32 build

2009-05-19 Thread Tim Golden
Michael Foord wrote: Distutils is undergoing heavy changes in the hands of Tarek Ziade. One of the changes is drastically improving the test coverage. I would definitely discuss the problem with him (directly or on distutils-sig) as he will want to know about it - either to explain why the chang

Re: [python-win32] Distutils changes broke pywin32 build

2009-05-19 Thread Tim Golden
Tim Golden wrote: Something in the changes to build_ext.py in r72585 has broken the setup.py build for pywin32: [... after discussions on distutils-sig ... http://mail.python.org/pipermail/distutils-sig/2009-May/011901.html ] Looking like it's an issue in distutils. Tarek's said h

Re: [python-win32] Converting types for deep lists or Discitonnaries

2009-05-21 Thread Tim Golden
Dominick Lauzon wrote: I need to convert a multi-level and multi-type list and dictionary (keys and values) to string format. Is there a way to do this globally rather than iterating item to str(item)? Not really a win32-specific question... but it's the kind of thing which gets asked and answ

Re: [python-win32] overview of ntfs permissions ?

2009-05-27 Thread Tim Golden
Stef Mientki wrote: hello, is there a way to get an overview of ntfs permissions, of a specified part of a directory tree ? (I've recently answered amost this question over on StockOverflow as it happens: it wasn't you, was it? :) ) One answer is to use cacls / xcacls, the command-line tool w

Re: [python-win32] Query on - win32 impersonate user

2009-06-08 Thread Tim Golden
Vikas NV wrote: Hi, I have been trying to use the Impersonate user code that you have in the PyWin32.chm document. [... snip ...] obj = Impersonate('another_user', '01928348') obj.logon() print win32api.GetUserName() os.system('bash sleep.sh') obj.logoff() Unfortunately

[python-win32] MAPI CopyMessages

2009-06-08 Thread Tim Golden
Has anyone had success using the PyIMAPIFolder CopyMessages method? The spambayes source looks as tho' it's using it happily, so I can't imagine there's any fundamental problem. Only... it doesn't work for me. :( I have a reproducible test case attached which is -- in the way of the extended MAPI

Re: [python-win32] MAPI CopyMessages

2009-06-08 Thread Tim Golden
Tim Golden wrote: Has anyone had success using the PyIMAPIFolder CopyMessages method? The spambayes source looks as tho' it's using it happily, so I can't imagine there's any fundamental problem. Only... it doesn't work for me. :( [... snip ...] Don't you hate i

Re: [python-win32] Regarding build of code using Visual Studio in python

2009-06-16 Thread Tim Golden
a h wrote: I have a C source code, i want to build it using Visual Studio without using its IDE. Actually i want to know that how do i write code/script in python so that it builds my "source.c" file and provides me "source.obj" and "source.exe" files. If that's really all you want, you don't r

Re: [python-win32] COM sending and receiveing events

2009-06-22 Thread Tim Golden
Christian K. wrote: Hi, I apologize for my ignorance about COM programming in advance. I would like to be pointed to an example of how I could send a message from a subthread of a COM server back to the main thread. Being an outlook addin, the COM server is already reacting to a couple of Outloo

Re: [python-win32] SetSystemTime: A required privilege is not held by the client

2009-06-24 Thread Tim Golden
Robert wrote: Tim Golden wrote: Robert wrote: SetSystemTime on Vista admin account throws: (1314, 'SetSystemTime', 'A required privilege is not held by the client.') Not known from previous Windows versions. With what switch or whatever can this be enabled? According t

Re: [python-win32] Permission denied erro while copying file from remote machine to local using win32wnet.WnetAddConnection

2009-06-30 Thread Tim Golden
siddhartha veedaluru wrote: Hi, I have used the following code snippet to copy files or folder from remote machine to local machine. I have used the same method to copy files to remote machine. Can some one point me to solve this? Am I missing something? Or can't you just catch the permissi

Re: [python-win32] Shell extension debugging

2009-06-30 Thread Tim Golden
Thomas Heller wrote: Gertjan Klein schrieb: 2) I see print statements in the source code, but I have no idea where they go; I checked the event log, but they are not there. Are they logged anywhere? If not, why are they there to begin with? Any other tip on how to effectively debug this stuff w

Re: [python-win32] Shell extension debugging

2009-06-30 Thread Tim Golden
Tim Golden wrote: Thomas Heller wrote: Gertjan Klein schrieb: 2) I see print statements in the source code, but I have no idea where they go; I checked the event log, but they are not there. Are they logged anywhere? If not, why are they there to begin with? Any other tip on how to

Re: [python-win32] Sourceforge pywin32 site seems to be down

2009-07-07 Thread Tim Golden
Fadhley Salim wrote: https://sourceforge.net/projects/pywin32/ Works for me. The Sourceforge PyWin32 download site seems to have been down for a very long time. Is there an alternate source of downloads? sf has just changed their entire site, it appears. There have been grumbles about it b

Re: [python-win32] Python parser for Windows Event Logs

2009-07-09 Thread Tim Golden
Tony Cappellini wrote: Thanks, but those just monitor events. I need to pull some very specific data from an event log file, after I know the event has already occurred. Tim has another module called winsys, and there is an object which handles some aspects of reading event logs. http://timgold

Re: [python-win32] Copying a MS Access Table

2009-07-28 Thread Tim Golden
sebastian.ve...@uk.bnpparibas.com wrote: Hi, how can I make a copy of a table in an Access database using Python? The VBA command would be 'DoCmd.CopyObject'. If there is no such command for Python, then alternatively I could request Python to call a VBA function that does that, but I don't kno

Re: [python-win32] Copying a MS Access Table

2009-07-29 Thread Tim Golden
[copying back to the list] Not sure how to reply to the thread, since I thought that if I reply to "python-win32@python.org" then it would start a new thread? Replying to python-win32@python.org is the right thing to do; the mailing list software should recognise all the clues it needs to con

Re: [python-win32] faster way to get printer status?

2009-08-05 Thread Tim Golden
Alec Bennett wrote: I'm trying to get the online/offline status of a printer, and using WMI I'm finding it very slow. Here's the code I'm working, maybe there's some way to opimize it? Or some other way? I'm able to use win32print to query the status of an online printer, but not to find out w

Re: [python-win32] regarding ftp api call

2009-09-23 Thread Tim Golden
a h wrote: Hi all i have created an ftp client using ftp api provided in python. whenever i disconnect my ftp client with the ftp server by removing the wired connection, my ftp application get hanged, i traced with prints and find that whenever call made to ftp api, it never came back. How do i

Re: [python-win32] regarding ftp api call

2009-09-23 Thread Tim Golden
[copying back to the list] Please keep the conversation on-list, a h. We're all happy to help you, but none of us is a private consultant -- at least not an unpaid one! Also, the more people who see what you post, the more people there are who might be able to answer. a h wrote: I have wriiten

Re: [python-win32] regarding ftp api call

2009-09-24 Thread Tim Golden
a h wrote: hi thanks for the replies. setting socket timeout works fine. I also find alternate way that perform the same thing,ie ftp connection timeout. import ftplib f = ftplib.FTP("server_host_name", "TIMEOUT") Thanks for posting back. And I learnt something new: that the FTP initialiser t

Re: [python-win32] win32api documentation

2009-10-09 Thread Tim Golden
J wrote: I've been searching high and low looking for any sort of decent reference for the win32api in python and I can't find anything that is useful. There isn't much, in spite of a few attempts (my own included) to get something going. There's never enough time... Ultimately, the win32api

Re: [python-win32] win32api documentation

2009-10-09 Thread Tim Golden
J wrote: Awesome! Thanks a lot. I'll dig into that after lunch. I finally stumbled on the ActiveState info on win32api with a ref for all the calls, and I'll have to do a little more digging. Well that's simply a copy of the CHM which is provided with the pywin32 installation. I host anoth

Re: [python-win32] win32api documentation

2009-10-12 Thread Tim Golden
J wrote: Ok... that all helped a lot. I've been playing around with memory a bit, and cache, and I'll poke at that some more later. Today I've been looking into processors. So WMI provides Win32_Processor and from what I've read, there exists one instance of Win32_Processor for each processor

Re: [python-win32] win32api documentation

2009-10-13 Thread Tim Golden
J wrote: And it does indeed work. We're using the latest 2.6, and so far everything has worked well. NumberOfCores and NumberOfLogicalProcessors does just what I hoped they would do, so now I have a small bit of n00b code: print "Getting processor information now...\n" I suspect you're coming

Re: [python-win32] wmi query error

2009-10-21 Thread Tim Golden
Nick Moszer wrote: Hello, I'm occasionally receiving the following error when doing a set of queries: Traceback (most recent call last): File "psg5220_demo.py", line 236, in find_hdd_drives partitions = services.query(query) File "...path..\wmi.py", line 889, in query return [ _wmi

Re: [python-win32] Calling random Windows function?

2009-10-23 Thread Tim Golden
Aahz wrote: I'm just getting into Windows programming for the first time, and I need to list all open files. Windows has a convenient function for that (NtQuerySystemInformation), but I can't figure out how I am supposed to call it. I bought of copy of the Win32 book and I can't find anything a

Re: [python-win32] Calling random Windows function?

2009-10-23 Thread Tim Golden
Aahz wrote: On Fri, Oct 23, 2009, Tim Golden wrote: Aahz wrote: I'm just getting into Windows programming for the first time, and I need to list all open files. Windows has a convenient function for that (NtQuerySystemInformation), but I can't figure out how I am supposed to c

Re: [python-win32] using WMI to get processor flags...

2009-10-24 Thread Tim Golden
Now I've got another question that I hope someone can provide the answer I want, not the one I'm afraid is coming ;-) What I haven't been able to find is a way to get a listing of processor flags (like FPU, MMX, SVN, VMX, SSE3, HTT, etc). Is there a way to do this without resorting to pycpuid?

Re: [python-win32] using WMI to get processor flags...

2009-10-28 Thread Tim Golden
Kevin Horn wrote: On Sat, Oct 24, 2009 at 4:14 AM, Tim Golden wrote: The CIM_ classes represent the DMTF Common Information Model [1], the structure on which WMI is based. In principle other manufacturers could implement WMI -- or whatever they would want to call it -- but as far as I am

Re: [python-win32] Options for running Python under IIS?

2009-11-12 Thread Tim Golden
Preston Landers wrote: On Thu, Nov 12, 2009 at 6:32 AM, Mark Hammond wrote: On 12/11/2009 10:03 AM, Preston Landers wrote: 4) Use isapi-wsgi: This seems to be getting more popular but it seems to use threads and I'm wondering whether this will break my app in subtle ways. Thread support shou

  1   2   3   4   5   6   7   >