Re: Window capture using WM_PRINT and Python

2005-01-18 Thread Roger Upole
Do you get any kind of traceback when you start a process that way? There's not much info to go on. Sys.argv parameters are passed as strings. You'll need to do an int() on them before you can use them as handles. Also, not all handles are portable between processes. Your device context

Re: makepy crashing

2005-01-18 Thread Roger Upole
Looks like the makepy step creates the generated file successfully, but python is choking with an assertion failure on lines longer than 512 when it tries to import it. This is the line it was processing when it died: def GetSpellingSuggestions(self, Word=defaultNamedNotOptArg,

Re: Automatic Windows printer creation?

2005-01-19 Thread Roger Upole
You can probably do it through WMI. (class is Win32_Printer) WMI works well with win32com, and there's also a wrapper module http://tgolden.sc.sabren.com/python/wmi.html for simplified access. I imagine getting all the device parameters and port configuration right will be messy, though.

Re: PyWin32 installation

2005-01-24 Thread Roger Upole
Gdi32 needs to be added to the libraries for win32print in setup.py. (just checked it in) Roger mg [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I have reinstalled my Win32 computer last week and I did an update of the project PyWin32 to complete my

Re: threading and internet explorer com

2005-01-27 Thread Roger Upole
You'll need to call pythoncom.CoInitialize() in each thread. Roger James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, i'm using python 2.4 with pywin32... I've tried to use internet explorer control with a class. it was fine until i decided to inherit thread for the

Re: PythonWin (build 203) for Python 2.3 causes Windows 2000 to grind to a halt?

2005-01-27 Thread Roger Upole
These look like symptoms of sf bug #1017504 http://sourceforge.net/tracker/index.php?func=detailaid=1017504group_id=78018atid=551954 What version of Pywin32 are you running ? There's a (semi) fix for this in the latest build. hth Roger Chris P. [EMAIL PROTECTED] wrote in message

Re: Description Field in WinXP Services

2005-01-29 Thread Roger Upole
ChangeServiceConfig2 is the api functions that sets the description, but it's not in the win32service module (yet). Roger rbt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How does one associate a Description with a Windows service written in Python? I've just started

Re: COM on a network drive can't find pywintypes23.dll

2005-01-31 Thread Roger Upole
This means the machine is finding an older verion of pywintypes23.dll first, rather than not finding it at all. You may have an old version hanging around in the \system32 directory on that machine. (or anywhere else that it would be found first). You might also want to verify that the dll's

Re: Where is WSAEnumNetworkEvents???

2005-02-03 Thread Roger Upole
From a quick look, it wouldn't be too difficult to wrap this function. Both the input arguments can be already be handled by Swig, and the outputs would just be an int and a fixed size tuple of ints. Roger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was trying to

Re: win32gui bug: where to report it?

2005-02-15 Thread Roger Upole
Win32all is called Pywin32 now, and resides on SourceForge: http://sourceforge.net/projects/pywin32/ Roger George van den Driessche [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's taken me ages to find out why my window, built out of win32all, wasn't receiving any

Re: pushing python to multiple windows machines

2005-10-21 Thread Roger Upole
[EMAIL PROTECTED] wrote: I am working on a project that requires python to be installed on a large number of windows servers and was wondering if anyone has found a method to do this. I found the article from 2003, but nobody ever stated that they have found an option for this.

Re: Using Python to add thumbnails to Explorer

2005-10-26 Thread Roger Upole
As you guessed, the icon locations are stored in the registry. There's a key under HKEY_CLASSES_ROOT for each registered file type, with a default value holding the class name. Under the class name, there's a DefaultIcon key that gives the path to the icon. Using python files an an example, you

Re: Small utility program for the windows

2005-10-26 Thread Roger Upole
It works fine for me (XP, Python 2.4.2). Where exactly do you get the access denied ? When writing to the registry, or trying to start python, or within the python code ? Roger Iyer, Prasad C [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am trying to create a small

Re: Using Python to add thumbnails to Explorer

2005-10-26 Thread Roger Upole
a .dll shell extension as per http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ shellcc/platform/shell/programmersguide/shell_int/shell_int_extending/ extensionhandlers/shell_ext.asp Not so simple, and not (directly) a job for Python. Thanks, Chris Roger Upole ([EMAIL

Re: Using Python to add thumbnails to Explorer

2005-11-02 Thread Roger Upole
] John J. Lee ([EMAIL PROTECTED]) wrote: : Roger Upole [EMAIL PROTECTED] writes: : Or, if not, then you can do it with module ctypes. : http://starship.python.net/crew/theller/ctypes/ : There's an O'Reilly book called something like win32 shell : programming that covers this stuff. : John

Re: putting an Icon in My Computer

2005-11-04 Thread Roger Upole
There's an example of how to add an item to the shell namespace in the Pywin32 demos: \win32comext\shell\demos\servers\shell_view.py hth Roger yaipa [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] All, I've been asked by my boss to put an Icon in WinXP's My Computer for

Re: NTFS reparse points

2005-11-04 Thread Roger Upole
You should be able to use win32file.DeviceIoControl with winioctlcon.FSCTL_SET_REPARSE_POINT to do this. (winioctlcon was added in build 205) The hard part is going to be constructing the REPARSE_GUID_DATA_BUFFER struct to pass in as the buffer. hth Roger Stanislaw Findeisen [EMAIL

Re: Problem printing in Win98

2005-11-20 Thread Roger Upole
According to MSDN, err code 31 from ShellExecute is SE_ERR_NOASSOC, meaning there's not an application registered for printing that file type. Roger Maravilloso [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I'm trying to automatically send a postscript file to be

Re: File locking is impossible in Windows?

2004-12-21 Thread Roger Upole
I get The process cannot access the file because another process has locked a portion of the file. 0 file(s) copied. on both Win2k and WinXP. (Python 2.4, Pywin32 build 203) Are you sure the log.txt you're copying to is actually the right one ? You should at least get a prompt to

Re: extract python install info from registry

2005-12-06 Thread Roger Upole
rbt [EMAIL PROTECTED] wrote: On windows xp, is there an easy way to extract the information that Python added to the registry as it was installed? You should be able to find all the entries in msi.py that's used to build the installer. Roger == Posted via Newsfeeds.Com -

Re: How can I load python script into Html ??

2005-12-13 Thread Roger Upole
Mozilla is growing python support: http://weblogs.mozillazine.org/roadmap/archives/008865.html Using Pywin32, Python can also be registered as an ActiveScript language so that it can be used in Internet Explorer. Roger -- Ask the ToeCutter - HE knows who I am ! Steve M

Re: query to find name of the OS, ip addr, mac addr etc

2005-12-13 Thread Roger Upole
If you have Pywin32 installed, you can use WMI to get all these details. The WMI classes to look at are win32_networkadapter and win32_operatingsystem. Roger -- Ask the ToeCutter - HE knows who I am ! [EMAIL PROTECTED] wrote: Hi all, 1) Am working on windows XP, and is there

Re: How can I load python script into Html ??

2005-12-16 Thread Roger Upole
Using the normail src attribute works for me: SCRIPT Language=Python src=somescript.pys/script Did you register the Python script engine with pyscript.py or pyscript_rexec.py ? Roger -- Ask the ToeCutter - HE knows who I am ! PatPoul [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: Windows Services

2005-12-19 Thread Roger Upole
Active State's help file is missing parameters from some modules built using Swig. The .chm included with the SourceForge releases has complete parameter info. hth Roger Mondal [EMAIL PROTECTED] wrote: Hi, Every one please accept my thanks. I have stopped using Python IDLE.

Re: How can I load python script into Html ??

2005-12-19 Thread Roger Upole
Claudio Grondi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PatPoul wrote: Yes I register Python script. I see in your exemple that you use file extention pys. That was why my exemple does'nt work. Thanks ! Patrick Poulin In this context I have a question: How can the

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread Roger Upole
If you have Pywin32 build 205 installed, you can use the win32console module to add the data to the typeahead buffer before you call raw_input. import win32console stdin=win32console.GetStdHandle(win32console.STD_INPUT_HANDLE) def raw_input_with_default(prompt, default_val): keypresses=[]

Re: run line or selection

2005-12-28 Thread Roger Upole
You can add your own entries under the Tools menu fairly easily. Go to View-Options-Tools Menu and enter the command name and code to be executed. hth Roger linda.s [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] is there any tool like run line or selection in Pythonwin?

Re: Is there any detailed debug tutorial for Pythonwin?

2005-12-28 Thread Roger Upole
Python Programming on Win32 has a lot of info in chapter 4. Roger linda.s [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there any detailed debug tutorial for Pythonwin? == Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==

Re: Windows and python execution

2005-12-28 Thread Roger Upole
The PATHEXT allows you to execute the script without typing the .py extension. Roger BartlebyScrivener [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Some of the confusion probably comes from which installation people use. I used the latest ActiveState distribution of Python.

Re: COM automation, Internet Explorer, DocumentComplete event

2006-01-10 Thread Roger Upole
PythonCom interfaces implement __cmp__ so that you can just use a straight == comparison. hth Roger puff [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm very new to Python and have a question concerning IE automation and detection of page completion. The MSDN

Re: Accessing Windows file metadata?

2006-01-11 Thread Roger Upole
The Pywin32 package wraps the interfaces used to read and write these properties. \win32com\test\testStorage.py demonstrates how to use them. There are actually two different ways that metadata is stored. For structured storage files created by COM applications, it's embedded directly in the file

Re: Placing graphics text on printed page - jan06call.jpg (0/1)

2006-01-12 Thread Roger Upole
Pywin32 wraps most of the GDI functions used to draw lines and text directly on a printer device context. Many of them are only implemented as methods of MFC objects rather than exposed directly. See \win32\Demos\print_desktop.py for some examples of working directly with a printer DC. hth

Re: Creating shortcuts?

2006-01-13 Thread Roger Upole
On Windows, Pywin32 allows you to create and manipulate shortcuts. See \win32comext\shell\test\link.py for a small class that wraps the required interfaces. hth Roger Ron Griswold [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Folks, Is it possible to create a shortcut

Re: HP open source printer drivers are in Python

2006-01-13 Thread Roger Upole
Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 2006-01-13, Andy Leszczynski [EMAIL PROTECTED] wrote: I have a specific question, anybody is familiar? Yes. You're a familiar ? Who's your wizard ? Roger == Posted via Newsfeeds.Com -

Re: python script under windows

2005-09-09 Thread Roger Upole
You can use the Task Scheduler to run a script persistently if you don't need the capabilities of the service framework. Roger Jan Gregor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello I run python script on another computer and want to survive that script after my

Re: HELP!! Accessing other machines with an IIS CGI script

2005-09-14 Thread Roger Upole
Without knowing what operation fails, it's kind of difficult to give any meaningful answers. At what point in the code do you get the error ? If IIS runs under a local account, it might not have permission to access the other machine, or to impersonate a domain user. You might want to set up

Re: CGI Problem on MS IIS 5.0 - Trying to access files on other machines

2005-09-15 Thread Roger Upole
You need to adjust your privileges before you call LogonUser. hth Roger paulp [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Greetings, I'm working on a CGI program that will run under MS IIS 5.0 and will browse folders on three other machines, building HTML pages that

Re: win32com.client.GetActiveObject()

2005-09-18 Thread Roger Upole
Basically, this means the application doesn't register itself with the Running Object Table. There's not much you can do about it, except maybe petition whoever makes ITunes. Roger David Nicolson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have been successfully

Re: Python win32com com_error: (-2147418113

2005-09-22 Thread Roger Upole
Usually this means the COM object has to run in a full ActiveX container. You can host it in IE, or Pythonwin can act as a container with some effort. See \pythonwin\pywin\Demos\ocx for some examples of using OCX objects that require a container. Roger g.franzkowiak [EMAIL PROTECTED]

Re: subprocess considered harmfull?

2005-09-25 Thread Roger Upole
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steven Bethard wrote: Using the following snippet: p = subprocess.Popen(nmake,stderr=subprocess.PIPE,stdout=subprocess.PIPE, \ universal_newlines=True, bufsize=1)

Re: subprocess considered harmfull?

2005-09-26 Thread Roger Upole
Uri Nix [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Roger Upole wrote: Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steven Bethard wrote: Using the following snippet: p = subprocess.Popen(nmake,stderr=subprocess.PIPE,stdout=subprocess.PIPE

Re: Font management under win32

2005-09-29 Thread Roger Upole
Here's an example of how to use EnumFontFamilies: import win32gui hdc=win32gui.CreateDC('DISPLAY','Display',None) fonts=[] def callback(font, tm, fonttype, fonts): fonts.append(font) print font.lfFaceName return True win32gui.EnumFontFamilies(hdc, None, callback, fonts) The

Re: Python script to install network printers

2005-10-04 Thread Roger Upole
You can use win32print.AddPrinterConnection(r'\\server\sharedprinter'). However, if the printer driver has to be copied to the client machine and installed, that's probably where most of the time is spent. hth Roger Matt Chan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

Re: Creating internet shortcuts

2005-10-09 Thread Roger Upole
Pythoncom doesn't directly support the necessary interfaces, but you can use the Shell COM interfaces to create them. import win32com.client wsh=win32com.client.gencache.EnsureDispatch('wscript.shell') s=wsh.CreateShortcut('c:\\python.url') s.TargetPath='www.python.org' s.Save() hth

Re: odbc errors

2005-10-16 Thread Roger Upole
[EMAIL PROTECTED] wrote: hi i have a piece of code: ... def connectdb(sql): import dbi import odbc import sys try: s = odbc.odbc('DSN=CONN;UID=user;PWD=pass') cur = s.cursor() # cur.execute(set nocount on) cur.execute(sql) while 1:

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 Windows

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 possible to

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 using

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/ Claudio

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

2005-06-12 Thread Roger Upole
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. Roger Upole wrote: [EMAIL PROTECTED

Re: Running WMI within a Windows service

2005-06-24 Thread Roger Upole
Build 204 of pywin32 has a change so that the working dir for a service is the folder where its executable is located instead of \system32, hopefully avoiding trying to import wmi.dll instead of wmi.pyd. Roger Tim Golden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL

Re: connecting to an exsisting COM server

2005-06-24 Thread Roger Upole
Normally you get that if the application doesn't register itself with the Running Object Table. Do you know if the COM server in question registers itself ? Roger jelle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I'm using

Re: exec method WMI

2005-07-13 Thread Roger Upole
You probably need to remove the SpawnInstance_() call. An abstract WMI class as returned by WBEM.Get should work for the DriverInfo parm, since the concrete Win32_PrinterDriver instance is what the AddPrinterDriver call is trying to create. hth Roger [EMAIL PROTECTED] wrote in

Re: 2.4 Recent File list not working

2005-07-14 Thread Roger Upole
There was a bug in MFC 7 that prevented Pythonwin from closing properly. Build 204 of Pywin32 has a workaround, but I'm not sure if it's been incorporated into ActiveState's distribution yet. Roger Larry Bates [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I recently

Re: Using SHFileOperation

2005-07-20 Thread Roger Upole
SHFILEOPSTRUCT is just a tuple, with the elements listed in docs. from win32com.shell import shell, shellcon shell.SHFileOperation((0, shellcon.FO_DELETE, 'somefilename', None, shellcon.FOF_ALLOWUNDO|shellcon.FOF_NOCONFIRMATION)) hth Roger avishay [EMAIL PROTECTED] wrote in message

Re: Listing partitions (on win32)

2006-01-15 Thread Roger Upole
Claude Henchoz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Is there any way of listing partitions on a (win32) computer without using WMI? Cheers, Claude Using win32file.DeviceIOControl with IOCTL_DISK_GET_DRIVE_LAYOUT as the control code should be able to retrieve the

Re: Listing partitions (on win32)

2006-01-15 Thread Roger Upole
Bengt Richter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 14 Jan 2006 16:52:33 -0800, Claude Henchoz [EMAIL PROTECTED] wrote: Hi Is there any way of listing partitions on a (win32) computer without using WMI? Maybe this will work (I skipped A: and B:, but you can include

Re: [help] how to generate a empty .MDB file using python

2006-01-15 Thread Roger Upole
Denton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all: I working in MS window environment. Now I want to use a python script to import some data from CSV file to MDB file. but I have some problems about creating MDB file in DAO. I am using attached code , but the last line

Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread Roger Upole
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Helo guys, I am trying to query the MSSQL DB using ADO. I am not able to make the LIKE statement fetch the correct results. Can anyone tell me what I need to do to get this working? Below is the code snippet: import

Re: Registering COM python based components when not admin

2006-01-18 Thread Roger Upole
To register the com server for only the current user, your base key should be HKEY_CURRENT_USER\SOFTWARE\Classes instead of just HKCU. However, I don't know if this will solve your problem or not. The ICatRegister interface is supplied by the system, so nobody but MS has the source code to the

Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
Paul Rubin http://[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Terry Hancock [EMAIL PROTECTED] writes: Very interesting. And rather sad that editors think the average Amermican reader too dim-witted to figure out (in context, even) that a car park is a parking lot and a

Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Roger Upole wrote: I wouldn't have figured out that a car park was a parking lot. I might have thought it was a park where you go to look at scenery from inside your car. Sort of a cross between a normal park

Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
Alex Martelli [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steven D'Aprano [EMAIL PROTECTED] wrote: ... I mean, when you read He sat on the chair do you need to look up the dictionary to discover that chairs can have arm rests or not, they can be made of wood or steel or

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. Does

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

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 up

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

Re: Seaching Active Directory via ADO

2006-02-16 Thread Roger Upole
You could also accomplish the same thing using the Command object, but this way is usually more concise for plain Sql. Roger LittlePython [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I notice there is no adodb.command. This is not required? Thx for the example! Roger

Re: Seaching Active Directory via ADO

2006-02-17 Thread Roger Upole
, LCID, wFlags, retType, argTypes ) + args) pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Provider', 'Tabl e does not exist.', None, 1240640, -2147217865), None) C:\Documents and Settings\Administrator\Desktop\pytest Roger Upole [EMAIL PROTECTED] wrote in message news:[EMAIL

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='Roger*' )

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

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

Re: Need some Python help

2005-02-24 Thread Roger Upole
There's a bug in python's tokenizer that's triggered when the generated wrapper code for a COM object has lines longer than 512. See below link for a workaround: https://sourceforge.net/tracker/?func=detailatid=551954aid=1085454group_id=78018 Roger Matt Upton [EMAIL PROTECTED] wrote in

Re: winnt win32process.createProcess with stdout to file ?

2005-03-03 Thread Roger Upole
You'll need to pass security attributes with inherit=True to CreateProcess also, and the file has to be opened with sharing. (win32file.FILE_SHARE_READ|win32file.FILE_SHARE_WRITE) Also, you shouldn't have FILE_FLAG_OVERLAPPED set if you're not passing an overlapped object into CreateFile. hth

Re: winnt win32process.createProcess with stdout to file ?

2005-03-03 Thread Roger Upole
If it got past the CreateFile call, the problem's not with the log file. This error from CreateProcess means it can't find your executable. Roger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Roger, I updated the script (below).. but now I get errors... many thanks for

Re: winnt win32process.createProcess with stdout to file ?

2005-03-04 Thread Roger Upole
TerminateProcess doesn't give it a chance to exit normally and do any cleanup that would happen if it exited itself. It may not have been able to flush its file buffers, etc. Does the executable have any way to signal it to exit ? Roger [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: Win32 drive mapping... aka net use

2005-03-05 Thread Roger Upole
You could use win32api.GetLogicalDriveStrings to list the drive letters currently in use, and find the next free letter. net use * probably does something like that under the covers. hth Roger Lucas Machado [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Alex

Re: Win32 drive mapping... aka net use

2005-03-05 Thread Roger Upole
The split should work fine if you remove the r (raw string) prefix. win32api.GetLogicalDriveStrings().split('\\\x00') ['A:', 'C:', 'D:', 'E:', 'F:', 'G:', 'H:', 'J:', 'K:', 'Y:', 'Z:', ''] Roger Lucas Machado [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Roger Upole wrote

Re: win32com and Python2.4: Interpreter crashing!

2005-03-07 Thread Roger Upole
There's a bug in the tokenizer that's triggered by the long lines generated by makepy. See http://sourceforge.net/tracker/index.php?func=detailaid=1085454group_id=78018atid=551954 and www.python.org/sf/1089395 Roger Tim N. van der Leeuw [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Roger Upole
In the reply to your post about the crash, there was a link to the bug report on Sourceforge that includes a workaround. Specifically, remove the mbcs encoding tag from the generated file. (or fromg genpy.py itself so that it never gets put into a new file) Does this do anything for the

Re: win32 shell extension (virtual drive)

2005-03-15 Thread Roger Upole
There's an example shell extension in the Pywin32 demos that creates a pseudo-folder whose contents are determined by python code. Take a look at \win32comext\shell\demos\servers\shell_view.py. However, I don't think it qualifies as 'simple' ;) Roger Tiziano Bettio [EMAIL PROTECTED]

Re: Getting the process list on win98

2005-03-15 Thread Roger Upole
WMI didn't come installed on Win98. You can download the addon for win98 from Microsoft. If I recall correctly from when I last used it on 98, GetObject didn't work for wmi. You might have to use win32com.client.Dispatch('Wbemscripting.Swbemlocator') to create the object. hth

Re: Win 32 - VB, Ruby, Perl VS Python with fireEvent

2005-03-23 Thread Roger Upole
I don't know why case would make a difference, but if I change the fireevent call to FireEvent, it works on XP sp2. It also works if you generate the makepy wrappers (probably because that forces case-sensitivity) hth Roger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

Re: wsh and Python

2005-04-09 Thread Roger Upole
Since AppActivate returns a boolean, you should be able to do something like this: while not shell.AppActivate(name): win32api.Sleep(100) Roger David Josty [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello I have this function :

Re: Read the windows event log

2005-04-13 Thread Roger Upole
You'll need to read in a loop until no records are returned. Roger Austin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] My codes are below: *** import win32evtlog def check_records(records): for i in range(0,len(records)):

Re: Updating Windows File Summary Data

2005-04-18 Thread Roger Upole
Pywin32 has functions to read and write these properties. Take a look at testStorage.py in the \win32\test directory for an example of how to use them. Roger Denrael [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am looking for a way in Python to update Windows File

Re: Internet Explorer, COM+, Javascript and Python

2005-04-28 Thread Roger Upole
Something like this should be close: import win32com.client, pythoncom ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 ie.Navigate('somepagewithjavascript.html') id=ie.Document.Script._oleobj_.GetIDsOfNames('somejsfunction') res=ie.Document.Script._oleobj_.Invoke(id, 0,

Re: Killing process

2005-04-29 Thread Roger Upole
TerminateProcess takes a process handle, not a pid. win32api.OpenProcess will give you a handle. Roger Harlin Seritt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am using os.getpid() to get the pid value for a script running. I store that value (as a string) to a file.

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 drive IE.

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 using

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 message

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 DEC's OSes

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 PROTECTED]

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

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

2005-05-19 Thread Roger Upole
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 Roger Upole wrote: The two you'll need to run makepy

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

2005-05-19 Thread Roger Upole
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 and Microsoft HTML object Library. If you run them manually, you should be able to look at the generated code to get the guids

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 message

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

  1   2   3   >