Re: How to select a folder with native windows dialog box?

2006-06-13 Thread Roger Upole
You can use SHBrowseForFolder: from win32com.shell import shell shell.SHBrowseForFolder() Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I found the win32ui.CreateFileDialog() function to select a file but > nothing to select a folder :'-( > Maybe someone has a solutio

Re: DispatchEx('.Application')

2006-06-13 Thread Roger Upole
There's a project to create a COM api for Firefox that's identical to IE: http://www.iol.ie/~locka/mozilla/mozilla.htm Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > When using win32com and DispatchEx to work with a webbrowser, eg: > > from win32com.client import Dispat

Re: How to select a folder with native windows dialog box?

2006-06-14 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks for your answer, it's working fine! > > For information, the function to use to get the pathName is > shell.SHGetPathFromIDList > It returns an error if you select a special folder (!?!?) but otherwise > it's working fine... And I

Re: Screen capturing on Windows

2006-06-14 Thread Roger Upole
"Rune Strand" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Is it possible by use of pyWin32 or ctypes to make a screen capture of > an inactive, or a hidden window if the hwnd/WindowName/ClassName is > known? I've seen dedicated screen capture software do this. While > PIL.ImageG

Re: win32com and name of com

2006-06-22 Thread Roger Upole
"bli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi all > first post. > I am using python to connect to dll. I have read everything I can find > on [EMAIL PROTECTED] > and tried all variations of the name of the dll to use in the Dispatch. > I get a com error-(-2147...1005, 'Inv

Re: embedded Python calling app via COM

2006-06-22 Thread Roger Upole
"Jim" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a C++ app which fires up a Python script using C API calls. > That script operates the app via Automation calls, like this: > > from win32com.client import * > from mywrapper import * > > myapp = Application() > myapp.Visibl

Re: occasional win32com error

2006-06-22 Thread Roger Upole
You could try using DispatchEx to make sure you always get a new instance of Excel. Roger "Ransom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey folks... > > Newbie here. I'm working with win32com launching, closing and > re-launching Excel grabbing output and doing stu

Re: Help with conversion VB script to Python : COM objects

2006-06-27 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I need to re-write a VB script into Python (because I really don't like > VB). > > The VB script is used to create a Windows COM object. > (I am more of Unix guy, so COM objects are a little bit alien for me). > > At a certain p

Re: MSoffice metadata

2006-06-27 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi > is there a module in Python to extract metadata in MS office documents > thanks > The Pywin32 package (http://sourceforge.net/projects/pywin32/) wraps the interfaces used to read and write document properties. Specifically, you can

Re: Controlling Windows Media Player from Python

2006-07-03 Thread Roger Upole
"Jeffrey Barish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a way to interact with Windows Media Player from Python? I would > like to be able to do things like tell WMP to play a given sound file or to > ask WMP for metadata about a sound file. > -- > Jeffrey Barish

Re: Launching multiple instances of a program with win32com.client.Dispatch?

2006-07-06 Thread Roger Upole
win32com.client.DispatchEx should create a new instance. Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there, I am trying to launch a program called AmiBroker using the > command: > > AB = win32com.client.Dispatch("Broker.Application") > > However, I have a dual-co

Re: Questoin about outlook calendar

2006-08-29 Thread Roger Upole
"Gallagher, Tim (NE)" wrote : > import win32com.client > import time > import datetime > > outlook = win32com.client.Dispatch("Outlook.Application") > namespace = outlook.GetNamespace("MAPI") > appointments = namespace.GetDefaultFolder(9).Items > > #print appointments.count > x = 4 # This is a nu

Re: Questoin about outlook calendar

2006-08-31 Thread Roger Upole
"Gallagher, Tim F (NE)" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "Gallagher, Tim (NE)" wrote : > import win32com.client > import time > import datetime > > outlook = win32com.client.Dispatch("Outlook.Application") > namespace = outlook.GetNamespace("MAPI") > appointments = na

Re: makepy, ADO and dynamic.py

2006-09-10 Thread Roger Upole
"Chris Curvey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to track down a performance issue in my Windows code, and > hotshot is telling me that the most time and calls are spent in these > methods > > ncalls tottime percall cumtime percall filename:lineno(funct

Re: How to get ip setting, dynamic ip or static ip?

2006-09-21 Thread Roger Upole
"kode4u" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How to use python get my windows box's ip setting type? Dynamic ip, or > static ip? > > If it's static ip, what's the exact value? > You can use WMI to list properties of your network adapter(s): import win32com.client wmi=win3

Re: Win32: Access to network resources w/o user login

2006-09-26 Thread Roger Upole
"utabintarbo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a way to (programmatically) access network resources from a > WinXP client without a user being logged in? I guess I need to know > where the fstab file is in Windows. :-P > > Some more background: I am trying to

Re: How to get ip setting, dynamic ip or static ip?

2006-09-27 Thread Roger Upole
;169.254.52.213',) > Traceback (most recent call last): > File "", line 2, in > File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line > 187, in __str__ >return str(self.__call__()) > UnicodeEncodeError: 'ascii' codec can&#x

Re: Starting Win32 Service

2006-09-28 Thread Roger Upole
Tim Golden wrote: ... > Yes, sorry about that, it's a well-known (to me) gotcha. > Basically there's no way I can extract the params from > the COM interface in a way which implies order, so I > can't take them in positionally. (Corrections to this > statement will be gratefully received). > > TJG

Re: creating a small test server on my local computer

2006-09-29 Thread Roger Upole
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Irmen de Jong wrote: >> John Salerno wrote: >>> Ok, this is completely unnecessary so I don't intend to get into stuff >>> that's beyond my skill, but I'm wondering how simple >>> it would be to use Python to create a se

Re: DAT file compilation

2006-09-30 Thread Roger Upole
On Windows NTFS file systems, you can add data to a file using named streams. The extra streams aren't visible from Explorer so the average end-user won't even know they're there. Roger "Jay" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > That cgi idea is really cool, but

Re: DAT file compilation

2006-09-30 Thread Roger Upole
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger Upole wrote: >> On Windows NTFS file systems, you can add data to a file using named streams. >> The extra streams aren't visible from Explorer so the average end-user won&

Re: Accessing file metadata on windows XP

2006-11-28 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > When rightclicking a, for example, pdf file on windows, one normally > gets a screen with three or four tags. Clicking on one of the summary > tag one can get some info like "title", "Author", "category", "keyword" > etc.. > > My quest

Re: Win32 Excel Generation Slow

2006-12-01 Thread Roger Upole
"Daniel Bowett" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am trying to create an excel document that displays a table of data. It does >exactly what I want but takes a long time. I am >writing around 1000 rows and it takes around a second to do each row. > > Is there a quick

Re: PythonWin And Excel Problem

2006-12-01 Thread Roger Upole
"Andrea Gavana" <[EMAIL PROTECTED]> wrote: > Hi All, > >I am having some problems in running a very simple python script, > which prints some numbers in an Excel spreadsheet. The numbers are > stored in a list. I know that the numbers are different (random > generated), but when I open the Exce

Re: good documentation about win32api ??

2006-12-01 Thread Roger Upole
"__schronos__" wrote: > Hi all. > > Recently I've to developed a project in python that made operation > under win32 platform and I found a lot of problema to find good > information. The only one documentation is in ActivePython page > (http://aspn.activestate.com/ASPN/docs/ASPNTOC-APYTH2.4.0) bu

Re: Security Descriptor and CoInitializeSecurity

2006-12-02 Thread Roger Upole
Huayang Xia wrote: > I'd like to call pythoncom.CoInitializeSecurity with a > PySecurityDescriptor object to set the process-wide security values. > But I'm not able to find a way to let the code go through. > > I have read MSDN and searched web, I've not been able to find answer. I > cooked a sec

Re: Need Simple Way To Determine If File Is Executable

2006-12-17 Thread Roger Upole
Gabriel Genellina wrote: > On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: >> > os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH > >>This will tell you that "x.exe" is executable, even if "x.exe" contains >> nothing but zeros. > > Isn't the same with any other recipe, portable or n

Re: Need Simple Way To Determine If File Is Executable

2006-12-17 Thread Roger Upole
Tim Daneliuk wrote: > Roger Upole wrote: >> Gabriel Genellina wrote: >>> On 16 dic, 04:47, Tim Roberts <[EMAIL PROTECTED]> wrote: >>>>> os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH >>>> This will tell you that "x.exe&quo

Re: tricky(?) win32com question - Mark Hammond or other experts please.

2006-12-20 Thread Roger Upole
[EMAIL PROTECTED] wrote > OK, I've asked this earlier this week with no response. Since then I've > also received a suggestion from the app developers but that failed with > the same type error problem. Hopefully Mark Hammond or other experts > can offer a suggestion as to how to get around this p

Re: Windows Authetication vs seperate process

2006-12-20 Thread Roger Upole
[EMAIL PROTECTED] wrote: >I was wondering of someone could steer me in the right direction. > > We have a package that we would like to "secure" so that only specific > individuals can access specific portions of the application. Our > wxPython application will revolve around updating a central d

Re: win32com early binding problem

2006-01-25 Thread Roger Upole
"Roland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I'm trying to use Sparx Systems Enterprise Architect OLE automation > interface. There is no problem to get early binding interface using > Microsoft Visual Basic. But using win32com makepy utility there problem > is.

Re: ODBC

2006-01-26 Thread Roger Upole
>From the syntax, this appears to be the odbc module included with the Pywin32 package. http://sourceforge.net/projects/pywin32/ You probably have it installed with the 2.1.1 version, but not 2.4. hth Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I would like to

Re: Embedding an Application in a Web browser

2006-02-14 Thread Roger Upole
Using the Pywin32 extensions ( http://sourceforge.net/projects/pywin32/ ) , you can register Python as an Active Scripting language. Then it can be used anywhere javascript or vbscript are used, in IE, ASP, etc. It should only be used in IE for trusted applications, however. Roger "rodm

Re: Python and ASP

2006-02-14 Thread Roger Upole
It looks like you have a space before the first Response.Write. This works fine for me if that line is left-justified. hth Roger "Tempo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I recently uploaded a sample ASP-Python page to my web server and it > didn't show u

Re: Python and ASP

2006-02-14 Thread Roger Upole
ASP files have to be served up by a web server. Roger "Tempo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It still doesn't work. I fixed that one error that you pointed out > Roger Upole, but it still isn't working. All I did was copy

Re: Python and ASP

2006-02-15 Thread Roger Upole
No, what I mean is that until you upload the file to the web server and request it back thru the server, it's just a text source file. However, let me make sure I understood your previous post. I had thought you meant you were opening the ASP file directly, as in locally and not from a web servic

Re: Seaching Active Directory via ADO

2006-02-16 Thread Roger Upole
t; Thx for the example! > "Roger Upole" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Here's a short example that uses ADO to search for a > > user by wildcard. > > > > import win32com.client > > c = win32com.client.Dispatch(

Re: Seaching Active Directory via ADO

2006-02-17 Thread Roger Upole
t\dynamic.py", line 258, > in > _ApplyTypes_ > result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, > argTypes > ) + args) > pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Provider', > 'Tabl > e does not

Re: Seaching Active Directory via ADO

2006-02-17 Thread Roger Upole
Here's a short example that uses ADO to search for a user by wildcard. import win32com.client c = win32com.client.Dispatch("ADODB.Connection") c.Open("Provider=ADSDSOObject") rs,rc=c.Execute(""" SELECT adspath, title, name >From 'LDAP://DC=yourdomain, DC=COM' where objectClass='user' and name='Ro

Re: Print a PDF transparently

2006-02-20 Thread Roger Upole
This seems to work ok with acrobat 7 (don't know if it will work with earlier versions). The only thing I had to tweak was acrobat's security setting for allowing print via script operations. I didn't try to figure out how to wait until the print was finished. hth Roger impor

Re: listdir() - any way to limit # of file entries?

2006-02-22 Thread Roger Upole
You can use win32file.FindFilesIterator to loop thru the files without creating a huge list of everthing in the folder. hth Roger "Peter A. Schott" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I want to build a program that does some archiving. We have several pr

Re: how to record how long i use the intenet

2006-03-04 Thread Roger Upole
[EMAIL PROTECTED] wrote: > use python > use ADSL > use windows XP > i want to record the time when i get on the internet and off the > internet > into a txt file > HOW? > You might be able to get that out of the event log. Most types of connections record connect and disconnect events in the Syst

Re: win32com and IIS

2005-05-10 Thread Roger Upole
Are you authenticating when you connect to the web server ? If you're connected as an anonymous user, you don't have enough privilege. Roger "Chris Curvey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I have a python script that uses the PAMIE libraries to dri

Re: win32com Dispatch() and SetPriorityClass()

2005-05-12 Thread Roger Upole
The ie object exposes its window handle as attribute HWND, and you should be able to use win32process.GetWindowThreadProcessId to get the thread id and process id that created the window. hth Roger "Chris Curvey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > if I'm usin

Re: working directory for debugging in pythonwin

2005-05-13 Thread Roger Upole
You could pass the directory in as an optional extra argument to the script. Alternately, you might accept either a bare file name or a full path. Roger -- This signature was intentionally left blank. (except it's not, wtf ??) "Thomas Pfaff" <[EMAIL PROTECTED]> wrote in messag

Re: Launch file in Notepad

2005-05-13 Thread Roger Upole
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 12 May 2005 15:34:39 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> I think the use of forward slashes for command line switches >> was adopted by CP/M from DE

Re: PythonWin + Tkinter = broken relation with WindowsXP !?!?!

2005-05-16 Thread Roger Upole
What version of pywin32 are you running ? You might want to try upgrading to build 204 if you haven't already. There was a bug where a toolbar registry key was written multiple times, which eventually fills up the registry and slows the machine down, along with some strange window behaviour.

Re: Problem listing services with wmi

2005-05-16 Thread Roger Upole
The only thing I could find for the hresult is that it corresponds to wbemErrCriticalError. According to this page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wbemerrorenum.asp it's some kind of internal error. Roger "Jean-Sébastien Guay" <[EMAIL PROTECTE

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-19 Thread Roger Upole
The two you'll need to run makepy for are Microsoft Internet Controls and Microsoft HTML object Library. If you run them manually, you should be able to look at the generated code to get the guids. Here's a minimal example: import win32com.client ie_mod=win32com.client.gencache.EnsureModule('{EA

Re: soundcard readout on a windows system

2005-05-19 Thread Roger Upole
Take a look at the directsound module from Pywin32. I haven't used it myself, but it may be able to do what you need. Roger "Jan Wienhausen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I would like to read out the soundcard with python on a win system. Is > there

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-19 Thread Roger Upole
below provides > events from the web browser control. I need to find out on which > particular HTML tag did the user click for example. > How do I find that out? There should be some way to refer to a document > from a given web browser control and start receiving events from it > > &g

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-19 Thread Roger Upole
d the user click for example. > How do I find that out? There should be some way to refer to a document > from a given web browser control and start receiving events from it > > > Roger Upole wrote: >> The two you'll need to run makepy for are Microsoft Internet Controls >

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-19 Thread Roger Upole
t; This appears to be a fairly common error when COM objects are not > hooked up properly. Though I have not been able to find a solution or > the reason for this. > Thanks again for the explanation.All the information that I had > acquired now seems to fall into place. I was not awa

Re: how to config a comserver in a customize dll?

2005-05-20 Thread Roger Upole
If you have a custom COM dll, you should just register it as normal. I'm not sure why you would want to register it as a python COM server. Unless you've duplicated the whole framework that allows com servers to be written in python ? Roger "ÒÊÃÉɽÈË" <[EMAIL PROTECTED]> wrote in mess

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-21 Thread Roger Upole
There does appear to be some sort of conflict between the two event hooks. I wasn't seeing it before since IE was getting google from my browser cache and it was coming up almost instantaneously. As soon as I switched the URL to a page that loads slowly, I got the same result. Adding win32gui

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-21 Thread Roger Upole
so anybody else trying to do something similar knows some of the pitfalls. Roger "J Correia" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Roger Upole" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> There do

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-22 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... > The problem is that msdn documentation says that in order to identify > the element that was clicked - one has to query on IHTMLWindow2::event > property on iHTMLWindow2 interface to get IEventOBj interface and then > from there - u

Re: Com object questions

2005-05-23 Thread Roger Upole
Does IPADDRESSSTRUCT appear anywhere in the makepy-generated module ? Specifically, there should be a RecordMap dict containing any defined Records and their GUID's. Roger "Gijs Korremans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I'm still figuring out how I can

Re: re[2]: Com object questions

2005-05-24 Thread Roger Upole
I took a look at the code that generates the Record info, and it doesn't handle records that don't have a guid (or more accurately, the guid is GUID_NULL). They're still supposed to show up in the generated module with a comment stating that they weren't handled. However, it's trying to keep t

Re: win32clipboard.GetClipboardData() return string with null characters

2005-05-26 Thread Roger Upole
I don't get any extra characters. Do they always show up, or is it possible whatever application put the data on the clipboard put them there ? Roger . "aurora" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I was using win32clipboard.GetClipboardData() to retrieve the Windo

Re: how to retrieve info about print jobs

2005-06-02 Thread Roger Upole
There are functions for managing printers and print jobs in the win32print module from the Pywin32 package. Roger "Guy Lateur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > We have several printers in our company network. I would like to know if it > is possibl

Re: Using PAMIE to upload and download files...is it possible?

2005-06-06 Thread Roger Upole
As I understand it, newer versions of IE have uploading and downloading via script disabled as a security measure. You might be able to do some low-level API calls to deal with the download window. Roger "scrimp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ive been usin

Re: what can happen if Python wents commercial ;-) ...

2005-06-06 Thread Roger Upole
So that's how the PSF is raising funds now ! Roger "Claudio Grondi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > don't click the following link if you are not > at least 18 years old (or don't like sexual > related content): >http://www.python.com/ > > Clau

Re: How to receive events (eg. user mouse clicks) from IE

2005-06-12 Thread Roger Upole
ithin main - I do not > get any Onclick event. I also do not get an OnMousemove event if I move > the mouse. However, I do get on Mousemove event on a tag called as > frameset (which is part of the top page). > How does one get events from the frames then? > As always thanks a lot. > >

Re: Can os.remove followed by os.path.isfile disagree?

2007-06-06 Thread Roger Upole
[EMAIL PROTECTED] wrote: > Can os.path.isfile(x) ever return True after os.remove(x) has > successfully completed? (Windows 2003, Python 2.3) Yes. If another application has opened the file with FILE_SHARE_DELETE, os.remove succeeds but the file doesn't actually disappear until the last open ha

Re: How do I remotely access Scheduled Tasks from Windows XP to Windows Server 2003?

2007-06-30 Thread Roger Upole
"kj7ny" wrote: > How can I access and manipulate Scheduled Tasks in Windows using > Python? > > I have a Windows XP workstation running Python 2.4.4 using the > win32all modules to control the windows services on multiple Windows > 2003 servers. It works great. > > However, I also need to remotel

Re: windows cetificates

2007-07-04 Thread Roger Upole
m.banaouas wrote: > hi, > > is there any way to decrypt an email (already read with poplib, so available > on client side) with python using a window > certificate (those we can see on ie/internet options/content/certificates) ? > > the purpose is to decrypt an email sent and crypted by the send

Re: how to serialize a COM object ?

2007-04-24 Thread Roger Upole
"Carsten Haese" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 2007-04-24 at 13:10 -0700, vml wrote: >> I have a problem : >> >> I have a COM object. >> >> I would like to pass this com object from a server to a client through >> a socket. > > That is just as feasible as pas

Re: Python-URL! - weekly Python news and links (Apr 30)

2007-04-30 Thread Roger Upole
Cameron Laird wrote: > QOTW: "That is just as feasible as passing a cruise ship through a phone > line." - Carsten Haese, on transporting a COM object across a network. > Less vividly but more formally, as he notes, "A COM object represents a > connection to a service or executable that is running

Re: Python-URL! - weekly Python news and links (Apr 30)

2007-04-30 Thread Roger Upole
"Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, > Roger Upole <[EMAIL PROTECTED]> wrote: >>Cameron Laird wrote: >>> QOTW: "That is just as feasible as passing a cruise ship through

Re: WebBrowser: How to cast the document object

2007-05-06 Thread Roger Upole
"zdp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, all, > > My project is based on wxPython, and I need an IE control (i.e. > WebBrowser ActiveX control). Although the wxPython implements a > wrapped version (wx.lib.iewin.IEHtmlWindow), but it doesn't meet all > my demands, be

Re: Cancelling events on a COM Object

2007-08-16 Thread Roger Upole
Oliver Nelson wrote: >I have MapPoint working in Python, and I'm trying to cancel events on the map, >but I can't seem to make that happen. I'm >responding to the events successfully in my panel object. My code is like >this: > > global MapPointMod > MapPointMod = > win32com.client.gencache.

Re: Getting subprocesses to be hidden on Windows

2007-08-28 Thread Roger Upole
geoffbache wrote: > On 28 Aug, 18:18, Larry Bates <[EMAIL PROTECTED]> wrote: >> geoffbache wrote: >> > Hi, >> >> > As part of my efforts to write a test tool that copes with GUIs >> > nicely, I'm trying to establish how I can start a GUI process on >> > Windows that will not bring up the window. S

Re: Printing Using Python

2007-04-17 Thread Roger Upole
"Raja" <[EMAIL PROTECTED]> wrote: > Hi, > Attached is the code . I want my program to save the current printer > job properties and , when I reconnect the printer at a latter date , i > need to print the saved job . Can you please help with my code ? How > to print a document at a later stage and

Re: win32com COMAdminCatalogObject Value method

2007-10-01 Thread Roger Upole
rc wrote: > I'm trying to convert VB code that registers COM+ components to > Python. However, I'm unable to set values on COMAdminCatalogObject > using the Value() method, it seems to think I'm trying to call the get > method. > > VB Code: > Dim cat As COMAdminCatalog > Set cat = New COMAdminCata

Re: Python service gets interrupted function call

2007-10-12 Thread Roger Upole
"ashish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > I wanted to know how to handle events like 'logoff' in the main thread > so that any process which is being run by svcDoRun method of service > does not get 'interrupted function call' exception. > > I am posting a ve

Re: how to get the NT event log properties with OnObjectReady() with python

2007-10-13 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to get a notification from the NT event for any new event > using the DispatchWithEvents() function. Everything seems to be > working the way I wanted, but I don't know how to get the properties > of the event (ie. event type

Re: About Pywin32's invoke

2007-10-27 Thread Roger Upole
"kernel1983" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > By reading the doc of pywin32 > > we can invoke COM like: > >o = win32com.client.Dispatch("Excel.Application") > > > but is it possible to invoke some GUID directly? > Yes, you can do something like win32com.client.Dis

Re: Problem - Win32 Programming

2007-02-09 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi .. > > I'm a newbie to python win32 programming. I was just reading Python > Programming on Win32 and I was trying to run this program: > > # SimpleCOMServer.py - A sample COM server - almost as small as they > come! > # > # We expos

Re: NetUseAdd mystery

2007-02-26 Thread Roger Upole
king kikapu wrote: > Is anyone see any error in the following code: > >mapDrive = "MyServer\\C$" >data = {'remote' : mapDrive, 'local' : 'M:', 'password' : > 'mypassword', 'user' : 'Administrator', 'asg_type' : 0} >win32net.NetUseAdd(None, 1, data) > > It gives me "pywi

Re: win32com Excel bug?

2006-04-19 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm driving Excel from python, largely successfully. Now I'm trying to > add errorbars to XY scatter plots. Keep getting a com_error. Can't > track down the problem. > > I modified a simple example to duplicate the problem. Thanks to Mat

Re: pywin32 : scheduled weakup from standby/hiberate ?

2006-04-19 Thread Roger Upole
."robert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Windows the task scheduler tool can program (the BIOS?) to weak up the > machine from standby/hibernate at certain > pre-configured times. Can this be done directly through the (py)win32 API? > > robert Pywin32 has a task

Re: win32com.client.constants - AttributeError

2006-04-20 Thread Roger Upole
The constants are only available if you've run makepy on the Word object library. Roger "kbperry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On my machine, this runs fine, but when I try to run it on someone > elses machine it blows up with an attribute error: > > > imp

Re: win32com.client.constants - AttributeError

2006-04-21 Thread Roger Upole
There are a couple of different ways to run makepy. Start Pythonwin, and from the menu select Tools->Com Makepy Utility. You should see a list of registered typelibs. Select "Microsoft Word x.y Object Library" and hit Ok. This can also be done programatically by initiating Word with win32com.clie

Re: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Roger Upole
You can use win32file.DeviceIoControl to link directories. I can post some code to do so if anyone's interested. Roger "Brian Quinlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Recently, I became responsible for maintaining some Python code, which was > organized as f

Re: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Roger Upole
win32file.DeviceIoControl(h, winioctlcon.FSCTL_SET_REPARSE_POINT, buf, 0, None) ## create a subdir in redirected dir and make sure it shows up in target dir os.mkdir(os.path.join(temp1,'new_dir')) assert os.path.isdir(os.path.join(temp2,'new_dir')) h.Close() Roger

Re: Playability of a file in windows media player

2006-05-03 Thread Roger Upole
The below code will catch the OnError event that's triggered when you specify a bad URL. import win32com.client class wmpevents: def OnOpenStateChange(self, NewState): """Sent when the control changes OpenState""" print 'OnOpenStateChange', NewState if NewState==win32co

Re: Customize IE to make a toolbar visible

2006-05-04 Thread Roger Upole
This does the trick for Google toolbar: import win32com.client ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 ie.ShowBrowserBar('{2318C2B1-4965-11d4-9B18-009027A5CD4F}',True,0) You should be able to just substitute the GUID for the Yahoo toolbar. Roger <[EMAIL P

Re: How to get the target of a Windows shortcut file

2006-05-05 Thread Roger Upole
persist.Load('someshortcut.lnk') print sh.GetPath(shell.SLGP_RAWPATH)[0] hth Roger "Steve M" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Below is some code adapted from something I think was written by Mark > Hammond. Originally I needed to create a Windows shortcut (li

Re: Active Directory Authentication

2006-05-05 Thread Roger Upole
If you have Pywin32 installed, you can use the win32com.adsi package to open an object with username/password credentials. See adsi.ADsOpenObject for details. Adsi also contains a number of interfaces for dealing with users, containers, etc. Roger "D" <[EMAIL PROTECTED]> wrote in messag

Re: Can Python kill a child process that keeps on running?

2006-05-05 Thread Roger Upole
Using Pywin32 (obviously not cross platform): import win32api,win32con h=win32api.OpenProcess(win32con.PROCESS_TERMINATE,False, ) win32api.TerminateProcess(h, ) Roger "I. Myself" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Suppose we spawn a child process with Popen. I

Re: get Windows file type

2006-05-08 Thread Roger Upole
If you have pywin32 installed, you can use the shell module. from win32com.shell import shell, shellcon shell.SHGetFileInfo(filename ,0, shellcon.SHGFI_TYPENAME) Roger "BartlebyScrivener" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Using Python on Windows XP, I am able to

Re: Python and windows bandwidth statistics?

2006-05-11 Thread Roger Upole
win32pdh from Pywin32 lets you access the network performance counters. Roger "Dave Reid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've been searching for a something in Python for me to be able to get > the total outbound or inbound bandwidth (in Windows (or cross-OS > c

Re: Is it possible to set the date/time of a directory in windows with Python? If so how?

2006-05-13 Thread Roger Upole
"ToddLMorgan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to set any of the dates (create, modification, access) of a > directory under windows with python. > > I'm trying to do this as I'm trying to write a unittest for a directory > cleaning script I'm writing (ie I n

Re: pythoncom and IDispatch

2006-05-16 Thread Roger Upole
"fraca7" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. I got a little problem while using pythoncom to automate IE; for some > reason, changing the 'selectedIndex' on an > instance of IHTMLSelectElement doesn't fire the 'onchange' event (I guess > this is a bug in mshtml)

Re: Creating an Active Desktop Window

2006-05-16 Thread Roger Upole
rodmc wrote: > Hi, > > Does anyone know how I can create an Active Desktop window from within > a Python script? It would also be good to know how to refresh that > window and nothing else. > > At present I have an application which writes to a file which is read > by the Active Desktop (embeded I

Re: documentation for win32com?

2006-05-23 Thread Roger Upole
The Excel docs are your best bet. The examples they give are all MS-specific languages like VB, but most translate fairly easily to Python. You can also run makepy on the Excel typelib, which will generate a file with all the methods, events etc available thru the Excel object model. Also, searc

Re: Scheduled Tasks - SetFlags

2009-01-13 Thread Roger Upole
kj7ny wrote: > How do I enable/disable a scheduled task using Python? > > I can get to a task: > >self.ts=pythoncom.CoCreateInstance > (taskscheduler.CLSID_CTaskScheduler,None,pythoncom.CLSCTX_INPROC_SERVER,taskscheduler.IID_ITaskScheduler) >self.ts.SetTargetComputer(u'SomeServ

Re: self signing a py2exe windows executable

2008-10-06 Thread Roger Upole
William Heath wrote: > Hi Roger, > I managed to get the dll and register it. I am now getting this error: > > Traceback (most recent call last): > File > "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 312, in RunScript >exec codeObject in __main__.__dict__ >

Re: self signing a py2exe windows executable

2008-10-06 Thread Roger Upole
William Heath wrote: >I don't know, how can I tell, sorry I am new to this. > -Tim > You can use the certificates snap in for MMC to view them. Start->Run and enter mmc.exe File->Add/Remove snapin Click the Add button, and then select Certificates. On some systems, you might find it already con

<    1   2   3   >