Re: An ODBC interface for Python 3?

2011-07-02 Thread Roger Upole
kozmikyak wrote: > Does anyone here have a Python 3 environment that can access MSSQL > using SQLAlchemy, running on a Windows 7 box? If so, I would like > some assistance making it happen. > > The last post on this was mid-2010. It was mentioned that pyodbc had > a Python 3 branch. I've been un

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) >> > os

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

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 parameters

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 PROTECTE

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 Roger

Re: win32com, generating the cache programaticaly?

2005-10-11 Thread Roger Upole
"Andrew Markebo" wrote: > > Hello! > > I am messing around with communicating between LabVIEW and Python, got > it to work by a small 'fix' (grabbing the generated file, and > importing it by hand) > > What I might want to do, is to automatically generate the data done by > executing makepy.py and

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) >

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. > > http:/

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 ha

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 u

Re: Using Python to add thumbnails to Explorer

2005-10-26 Thread Roger Upole
nd not (directly) a job for Python. > > Thanks, >Chris > Roger Upole ([EMAIL PROTECTED]) wrote: > : 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

Re: Using Python to add thumbnails to Explorer

2005-11-02 Thread Roger Upole
sage news:[EMAIL PROTECTED] > 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

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 Compute

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 P

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: 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: 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 handle

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, CustomDictionary=de

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 m

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

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=detail&aid=1017504&group_id=78018&atid=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 sta

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 you'

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: 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 > win32com.client.GetObject(Class='Rhino

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 messa

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 messag

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

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 audi

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 page

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 successfu

Re: Python win32com com_error: (-2147418113

2005-09-21 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: 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

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=detail&atid=551954&aid=1085454&group_id=78018 Roger "Matt Upton" <[EMAIL PROTECTED]> wr

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 f

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 Ma

Re: handling pywintypes.error exceptions

2005-03-05 Thread Roger Upole
You can capture the extra exception data like this. try: ...win32net.NetUseAdd(None, 1, {'remote':r'\\foo\bar','local':'X except pywintypes.error,details: ...err_code=details[0] ... Roger "Lucas Machado" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm using the win32 ap

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:

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=detail&aid=1085454&group_id=78018&atid=551954 and www.python.org/sf/1089395 Roger "Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote in message news:

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-10 Thread Roger Upole
Does the workaround for the crash do anything for this problem ? Mark has changed the makepy code to break up long lines, and a new build of Pywin32 should be out before long. Roger "Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have a

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 unwarrante

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: 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 confir

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, py

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 f

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

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

2005-12-16 Thread Roger Upole
Using the normail src attribute works for me: 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 PROTECTED] > Sorry I was not clear, my setup is

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

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 ques

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 Python

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== http://www.new

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 Pyth

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 MSD

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 short

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 - Unl

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 retri

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

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

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: > >impor

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

Re: OT: excellent book on information theory

2006-01-18 Thread Roger Upole
"Paul Rubin" 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

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

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

Re: using capicom with python

2006-07-17 Thread Roger Upole
"stéphane bard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > Has anyone ever used Python to work with Certificate Services in > Windows? I'm trying to capicom dll with pywin32. > > > I've found some reference about python and capicom in > this mail archive > http://mail.p

Re: How to automate user input at the command prompt?

2006-07-21 Thread Roger Upole
If you have the Pywin32 extensions installed, you can use the win32console module to send keystrokes directly to a command prompt via WriteConsoleInput. Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I'm working on a scirpt to be used on a windows machine and I need

Re: OS independent files

2006-08-03 Thread Roger Upole
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Thu, 03 Aug 2006 21:55:21 +0200, Jarek Zgoda <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> crystalattice napisa?(a): >> >> > If I want to make sure the file/directory is made in a user's home >> > directory (e.g. /home/u

Re: using an already running COM object with Dispatch

2006-08-06 Thread Roger Upole
"jiccab" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Greetings. > > with the following code, > > olApp = Dispatch("Outlook.Application") > > I am capable of getting a new instance of Outlook running. I would > like to be able to use the instance that is already running, if exists

Re: kerberos under windows

2006-08-11 Thread Roger Upole
Kamil Malinka wrote: > Hi > > i'd like to know, is there any package like pykpass for windows? Or how to > use this under windows. I need to authenticate > users with kerberos under windows environment and have no idea how. > Thanks for help. > > Kamil Malinka The Pywin32 package (http://sourcefo

Re: Kill process based on window name (win32)

2006-08-11 Thread Roger Upole
drodrig wrote: > Hi. > > I am trying to close/kill all processes that show visible windows on > Windows XP. So far I've created a script that uses win32gui.EnumWindows > to iterate through all windows, check for which windows are visible, > then send a WM_CLOSE message to the window to request tha

Re: Kill process based on window name (win32)

2006-08-13 Thread Roger Upole
# Allow some time for app to close >> time.sleep(10) >> # If app didn't close, force close >> try: >> handle = win32api.OpenProcess(win32con.PROCESS_TERMINATE, 0, p) >> if handle: >> win32api.TerminateProcess(handle,0) >> win32api.CloseHandle(handle) >&

Re: What would be the best way to run python client in the background

2006-08-16 Thread Roger Upole
You can use the Task Scheduler to run a script at login. It's not as robust as creating a service, but it's much less work. Roger "gel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > I have written a python client server app that keeps an eye on > processes starting and

Re: How can I enumerate all windows services and disable some of them?

2006-08-22 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I know that Module win32service has some functions on manipulating > win32 services. > But I still have 2 questions: > 1. how to enumerate all services? > 2. how to disable a certain one? > > Thanks in advance! > win32service.EnumServic

Re: COM and Threads

2006-10-12 Thread Roger Upole
"Teja" <[EMAIL PROTECTED]> wrote: >I have an application which uses COM 's Dispatch to create a COM based > object. Now I need to upgrade the application to a threaded one. But > its giving an error that COM and threads wont go together. Specifically > its an attribute error at the point where COM

Re: COM and Threads

2006-10-12 Thread Roger Upole
"Teja" <[EMAIL PROTECTED]> wrote: > > Roger Upole wrote: > >> "Teja" <[EMAIL PROTECTED]> wrote: >> >I have an application which uses COM 's Dispatch to create a COM based >> > object. Now I need to upgrade the application to

Re: COM and Threads

2006-10-13 Thread Roger Upole
"Teja" <[EMAIL PROTECTED]> wrote: > > Roger Upole wrote: > >> "Teja" <[EMAIL PROTECTED]> wrote: >> > >> > Roger Upole wrote: >> > >> >> "Teja" <[EMAIL PROTECTED]> wrote: >> >>

Re: Reading a Microsoft access file.

2006-10-18 Thread Roger Upole
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I googled for the answer but all the answer seem to imply that you > have to have Access installed on your system. I have a file that was > created using Access and I want develop a Python script to > read the file and produce a report. C

Re: Sending mouse events on Windows

2006-10-28 Thread Roger Upole
Radu Ciurlea wrote: > Hello, > I want to write a program that can generate mouse events. I'd like to > actually be able to control the pointer and generate clicks. Any > pointers on modules I could use for doing this? Any suggestions are > welcome. > tia > > Radu Take a look at win32api.mouse_eve

Re: More elegant way to obtain ACLs / permissions for windows directories than using "cacls" dos command?

2006-11-07 Thread Roger Upole
[EMAIL PROTECTED] wrote: > Is there a standard library module in Python 2.4 (Win32) that will > return directory permissions / ACLs (e.g. users, groups, and what > rights they have)? > > Otherwise, I'm faced with sending "cacls dirName" commands via os.popen > as below, and then parsing and compar

Re: More elegant way to obtain ACLs / permissions for windows directories than using "cacls" dos command?

2006-11-08 Thread Roger Upole
[EMAIL PROTECTED] wrote: > Could you give an example for listing security descriptors using the > win32security module? I looked at the documentation but found it > confusing. Thanks. There are some examples of using the security descriptor objects in \Lib\site-packages\win32\Demos\security. Also

Re: Change directory permission under windows

2006-11-08 Thread Roger Upole
__schronos__ wrote: > Hi. > > I would like to add users with full control access to a directory. I > can do it to a file in the following way: > > info=win32security.DACL_SECURITY_INFORMATION > sd=win32security.GetFileSecurity(DIR, info) > acl=sd.GetSecurityDescriptorDacl() > sidUser=win32securit

Re: win32com/python different behavour.

2006-11-10 Thread Roger Upole
bli wrote: >I have been developing an application driving a device through COM. I > used win32com (brilliant ) > and was at a fairly advanced stage being able to access the functions > of the device and access/ retrieve its data. > A week or two ago I did some overdue upgrading to all the component

Re: How to calc easier the "long" filesize from nFileSizeLow and nFileSizeHigh

2006-05-29 Thread Roger Upole
Shift nFileSizeHigh by 32 and add FileSizeLow. Roger "DurumDara" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi ! > > I get the file datas with FindFilesW. > I want to calc the filesize from nFileSizeLow and nFileSizeHigh with easiest > as possible, without again calling o

Re: Try/Except for ADSI GetObject

2006-05-31 Thread Roger Upole
"LittlePython" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am a little confused on why I can not detect an object that does not exist > with a try and except. If I understand ADSI correctly from what I have read > you do not create these objects but rather get them. They already

Re: WinPops

2006-05-31 Thread Roger Upole
"Hari Sekhon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > Is there a way of sending winpops (Windows Pop-Up / Net Send messages) in > python? > > Perhaps some library or something that I can use under both Windows and Linux? > > Hari On Windows, you can use win32net.Net

Re: Converting binary sid's to a hex string

2006-06-07 Thread Roger Upole
You can use the binascii module to convert the raw bytes of the sid to hex. binascii.b2a_hex(buffer(MySid)) Roger "LittlePython" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am trying to create a hexstring of a NT4 user account sid which I can in > turn use to query an e

  1   2   3   >