Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Tim Golden wrote: So it looks as though the MS docs are simply wrong? I haven't tried it with ctypes or a native C program, but I can't see that they should be any different. If I get a chance later I'll knock something up in C. OK, copying the standard MS example for cre

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Tim Golden wrote: Sounds reasonable, but isn't actually true. This works fine: import subprocess open ("t.bat", "w").write ("echo hello") subprocess.Popen ("t.bat") TJG Dave Angel wrote: The docs of Popen() state that it uses CreateProcess(

Re: win32 wins settings

2009-04-16 Thread Tim Golden
Toff wrote: hello I don't understand why this doesn't woks. def setwins(self): from win32com.client import GetObject objWMIService = GetObject("winmgmts: {impersonationLevel=impersonate}!.\\root\\cimv2") colNicConfigs = objWMIService.ExecQuery ("SELECT * FROM Win32_N

Re: How save clipboard data as bmp file

2009-04-20 Thread Tim Golden
gopal mishra wrote: I am trying to save my clipboard data (format is CF_ENHMETAFILE) as BitMap file (.BMP). Have a look at PIL's ImageGrab module: http://www.pythonware.com/library/pil/handbook/imagegrab.htm I'm not sure if the current version supports metafiles, but it's easy enough to try.

Re: How to save clipboard data as bmp file

2009-04-21 Thread Tim Golden
gopal mishra wrote: I have used ImageGrab.grabclipboard() to get the clipboard image data, it returns None. This function only supports if the clipboard data format is CF_BITMAP. Is there any way to save clipboard data format CF_ENHMETAFILE to bitmap file using win32 programming. Well I'm symp

Re:

2009-04-21 Thread Tim Golden
karlos barlos wrote: hello to everybody... having problem withe this code : dom = raw_input("The Domain name..:") ad_user.Put('userPrincipalName',user['login']+'@(['dom']) but it wont change whay ? Some more context would help, including a code fragment and traceback if there is a

Problem updating AD user [was: Re:]

2009-04-21 Thread Tim Golden
[... snip vague question re AD user update ...] ... and please add a (useful) subject line TJG -- http://mail.python.org/mailman/listinfo/python-list

Re:

2009-04-21 Thread Tim Golden
karlos barlos wrote: ok sorry TIM I just took some piece of code that ADDs users to AD import win32com,win32com.client def add_acct(location,account): ad_obj=win32com.client.GetObject(location) ad_user=ad_obj.Create('user','cn='+user['login']) ad_user

Re: python command not working

2009-04-22 Thread Tim Golden
83nini wrote: On 22 Apr, 10:04, David Cournapeau wrote: On Wed, Apr 22, 2009 at 4:44 PM, 83nini <83n...@gmail.com> wrote: thanks for the tip, how do i add the path of python into my %PATH%? >From the command line (and from memory, I don't use windows regularly): set PATH=C:\python25;%PATH%

Re: Would you support adding UNC support to os.path on Windows?

2009-04-22 Thread Tim Golden
Larry Hastings wrote: I've written a patch for Python 3.1 that changes os.path so it handles UNC paths on Windows. You can read about it at the Python bug tracker: http://bugs.python.org/issue5799 I'd like to gauge community interest in the patch. After all, it's has been declined bef

Re: [Python-Dev] .pth files are evil

2009-05-01 Thread Tim Golden
Chris Withers wrote: I'll say! I think .pth files are absolute evil and I wish they could just be banned. +1 on anything that makes them closer to going away or reduces the possibility of yet another similar feature from hurting the comprehensibility of a python setup. I've seen this view e

Re: Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread Tim Golden
jorma kala wrote: Hi, I'd like to process files in a directory which is in fact a short cut link to another directory (under windows XP). If the path to the directory is for instance called c:\test. I have tried both following code snipets for printing all names of files in the directory: ++ sni

Re: Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread Tim Golden
Tim Golden wrote: Windows shortcuts are Shell (ie GUI Desktop) objects rather than filesystem objects. The filesystem doesn't treat them specially; just returns the .lnk file (or whatever it's called). As a caveat: they don't actually *have* to be called .lnk (altho' the

Re: SQL and CSV

2009-05-05 Thread Tim Golden
Nick wrote: I have a requirement to read a CSV file. Normally, no problem, just import CSV and slurp the file up. However, in this case I want to filter out lines that have fields set to particular values. It would be neat to be able to do something like this. select * from test.csv where stat

Re: SQL and CSV

2009-05-05 Thread Tim Golden
Nick wrote: Part of the problem is that the 'selection' needs to be in a config file. I can put the if row['status'] != 'Cancelled': return True into a config, read it and eval it, but its not quite as clean as an sql route. Still not clear what the restriction is. If you were writing SQL you'

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread Tim Golden
justind wrote: Hello, I'm using http://code.activestate.com/recipes/156178/ to watch a folder in windows. Wow, that takes me back. There's a bit more info (and a different technique) here if you're interested: http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html Bu

Re: Complete frustration

2009-05-12 Thread Tim Golden
Dave Angel wrote: [... snip sound advice about file associations etc. ...] One thing to bear in mind is that any settings, however obtained, in the User part of the registry (HKCU\Software\) will override those in the Machine part of the registry (HKLM\Software...). If you think you've set t

Re: about Python doc reader

2009-05-13 Thread Tim Golden
Shailja Gulati wrote: Hi , I am currently working on "Information retrieval from semi structured Documents" in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? If you haven't already, get hold of the pywin32 extensions: http:/

Re: (Winows) Finding out which process has locked a file.

2009-05-13 Thread Tim Golden
CinnamonDonkey wrote: Hi all, Does anyone know how I can programatically find out which process (resolved to human friendly string, i.e. executable) has a lock on a file. I have a script running which occassionally fails because it is trying to delete a file in use by another process. When this

Re: please help with python program

2009-05-14 Thread Tim Golden
chedderslam wrote: IOError: [Errno 13] Permission denied: u'D:/My Music/Ani DiFranco/ Canon/Disc 1\\folder.jpg' I have removed the read-only attribute on the folder, and added "Everyone" with full control for security. Not sure what else to do. I would really like to get this working so any hel

Re: about Python doc reader

2009-05-14 Thread Tim Golden
[forwarding back to the list] Please reply to the list: I'm not the only person who can help, and I might not have the time even if I can. Shailja Gulati wrote: I have installed win32com but still not able to run tht code as its giving error File "readDocPython.py", line 1, in ? import

Re: about Python doc reader

2009-05-14 Thread Tim Golden
Shailja Gulati wrote: Sorry about mailing u Tim.It just happened by mistake. Reg win32api , i m still facing the same problem of Import error...Could anyone pls help?? m stuck Shailja. Did you download and install the download .exe from the link below? http://sourceforge.net/project/platfo

Re: about Python doc reader

2009-05-14 Thread Tim Golden
norseman wrote: I did try these. Doc at once: outputs two x'0D' and the file. Then it appends x'0D' x'0D' x'0A' x'0D' x'0A' to end of file even though source file itself has no EOL. ( EOL is EndOfLine aka newline ) That's cr cr There are two blank lines at begining. cr

Re: (Windows) Finding out which process has locked a file.

2009-05-15 Thread Tim Golden
CinnamonDonkey wrote: > I have to say, this has got to be one of the > least helpful groups I am subscribed to. I'm genuinely surprised to hear you say that, especially about this thread to which you (who appear to be the OP) have received several replies all pointing you towards the sysinternals

Re: capture stdout and stderror from within a Windows Service?

2009-05-15 Thread Tim Golden
Chris Curvey wrote: Ahhh, Blake put me on the right track. If you want any of the streams, you have to supply values for all of them, like so: p = subprocess.Popen(step, shell=True stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = p.com

Re: (Windows) Finding out which process has locked a file.

2009-05-15 Thread Tim Golden
CinnamonDonkey wrote: Thanx for the response Tim! :-) Great site! > I'm genuinely surprised to hear you say that... Early morning frustration... I appologise to all... you are totally right. Thank you to all for the responses. Well it's big of you to apologise. In return, I've managed to kno

Re: Photoimage on button appears pixelated when button is disabled

2009-05-17 Thread Tim Golden
Dustan wrote: On May 15, 2:59 pm, Dustan wrote: In tkinter, when I place a photoimage on a button and disable the button, the image has background dots scattered through the image. Searching the web, I wasn't able to find any documentation on this behavior, nor how to turn it off. So here I am.

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Tim Golden
David Lyon wrote: On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister wrote: Yes, but that processing will add /example/ to sys.path, right? It actually works the other way around. The directories listed in sys.path are scanned for .pth files. You can add packages by listing them inside

Re: Subversion commit from Python?

2009-05-19 Thread Tim Golden
Jack Trades wrote: I'm wondering if there's an easy way to do a 'svn commit' on a directory from Python. http://pysvn.tigris.org/ and in particular: http://pysvn.tigris.org/docs/pysvn_prog_guide.html TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: URGENT! Changing IE PAC Settings with Python

2009-05-20 Thread Tim Golden
K-Dawg wrote: Thanks for any response. I am in a crisis where one of our networking guys moved where our PAC file is housed. There was a group policy set in Active Directory that set the PAC file location in Internet Explorer to the new location. However, we have 100 remote centers that have a

Re: join two selects

2009-05-21 Thread Tim Golden
gert wrote: I am trying to figure out how to join two selects ? SELECT * FROM search SELECT eid, SUM(pnt) AS total_votes FROM vote CREATE TABLE votes ( eid INTEGER PRIMARY KEY, uid VARCHAR(64), pnt INETEGER DEFAULT 0, ); CREATE TABLE search ( eid INTEGER PRIMARY KEY, tx

Re: making a python program in windows

2009-05-22 Thread Tim Golden
rustom wrote: Thanks for this (and all other) tips. Strangely now my m/c shows things exactly like so. A new .py file gets associated with python but two days ago it was with pythonw?! Any recos on where I could read up on this stuff? I by "all this stuff" you mean: Windows file associations, t

Re: subprocess and win32security.ImpersonateLoggedOnUser

2009-06-01 Thread Tim Golden
Emin.shopper Martinian.shopper wrote: Dear Experts, I am having some issues with the subprocess module and how it interacts with win32security.ImpersonateLoggedOnUser. Specifically, I use the latter to change users but the new user does not seem to be properly inherited when I spawn further subp

Re: subprocess and win32security.ImpersonateLoggedOnUser

2009-06-01 Thread Tim Golden
[slightly rearranged for top-to-bottom reading...] On Mon, Jun 1, 2009 at 9:38 AM, Tim Golden wrote: Emin.shopper Martinian.shopper wrote: Dear Experts, I am having some issues with the subprocess module and how it interacts with win32security.ImpersonateLoggedOnUser. Specifically, I use

Re: Rename field in Access DB

2008-05-14 Thread Tim Golden
Iain King wrote: I'm manipulating an MS Access db via ADODB with win32com.client. I want to rename a field within a table, but I don't know how to. I assume there is a line of SQL which will do it, but nothing I've tried (from searching) has worked. Basic code: import win32com.client connectio

Re: exists=false, but no complaint when i open it!?

2008-05-15 Thread Tim Golden
globalrev wrote: print os.path.exists('C:\Users\saftarn\Desktop\NetFlixDataSet \trainingsetunzipped\training_set\mv_001.txt') d=open('C:/Python25/myPrograms/mapexperiments/maps/provinces-of- sweden.gif') d.close() Ummm. These are not the same files (unless you've got some bizarre NTFS link

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Wolfgang Draxinger wrote: 1) you should not hardcode the backslashes ('\'), instead use os.sep for it. With respect, the OP is creating a Windows desktop shortcut. Unless Microsoft suddenly decide to change their use of the backslash, I suggest that this is a needless generalisation. 3) You

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Wolfgang Draxinger wrote: 1) you should not hardcode the backslashes ('\'), instead use os.sep for it. With respect, the OP is creating a Windows desktop shortcut. Unless Microsoft suddenly decide to change their use of the backslash, I suggest that this is a needless generalisation. 3) You

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Mike Driscoll wrote: Ah. I was unaware of the Arguments parameter. That works quite well. Where does one find this information anyway? I think I found mine from bits and pieces scattered in various tutorials. The canonical place would be: http://msdn.microsoft.com/en-us/library/bb774950(VS.85)

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Duncan Booth wrote: It's not too hard to get the required command line from the registry: import _winreg print _winreg.QueryValue(_winreg.HKEY_CLASSES_ROOT, 'FirefoxURL\shell\open\command') and of course it throws an exception if firefox isn't installed. Then just replace %1 with the url t

Re: Using Python for programming algorithms

2008-05-19 Thread Tim Golden
Bruno Desthuilliers wrote: 2/ actually, all known Python implementations compile to byte-code. In curiosity, did your "actually" mean, in the French sense, "at the moment" or, in the English sense, "in contrast to something stated earlier"? Or maybe both? TJG -- http://mail.python.org/mailma

Re: List of disk drives on Windows?

2008-05-20 Thread Tim Golden
Bob Greschke wrote: This MUST have been asked before, but I can't seem to Google the right thing. How can I get a list of drives on a Windows box, like ["C:\", "D:\"], like I can if I do something like listdir("/Volumes") on a Mac? A couple of options to get the ball rolling: 1) win32api.Get

Re: Showing the method's class in expection's traceback

2008-05-22 Thread Tim Golden
Agustin Villena wrote: I don't see things like you, because I'm accustomed to design my software though classes and see the code in an "object = software's functional atom/component" way I agree that python's dynamic nature make things complicated here, but for me it its just an implementation pr

Re: UTF problem?

2008-05-25 Thread Tim Golden
Vesa-Matti Sarenius wrote: I am trying to set up Linux printing via Windows XP and using this HOWTO: http://justin.yackoski.name/winp/ I have one problem. When I send a file via CUPS to the windows spool directory dirwatch.py (http://justin.yackoski.name/winp/dirwatch.txt) dies and gives: Unic

Re: How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the workspace. You dou

Re: run a script in vista

2008-05-29 Thread Tim Golden
Graham Feeley wrote: Hi, I have a script which runs in xp, however now I have upgraded to vista this script now does'nt work Can someone help with this problem please ? this is the start of the script import cPAMIE import cModalPopUp import winGuiAuto as wga import time, datetime import os, sys

Re: Finding file details...

2008-05-29 Thread Tim Golden
Kalibr wrote: I've been trying to figure out how to find the details of files (specifically music for now) for a little sorting script I'm making, My aim is to get details on the artist, album, and genre for mp3 and wma files (possibly more in the future). My closest match was when I stumbled acc

Re: How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the workspace. You dou

Re: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
Tim Golden wrote: [EMAIL PROTECTED] wrote: I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a l

Re: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
[Bizarrely, my mail system seems to be randomly misfiring. If you've already seen this, please ignore!] Tim Golden wrote: Sorry, having seen Roger D's memcached suggestion, I realise I may have misinterpreted your requirement. I thought that you wanted a Python interpreter session to

Re: Finding file details...

2008-05-29 Thread Tim Golden
Kalibr wrote: On May 29, 7:55 pm, Tim Golden <[EMAIL PROTECTED]> wrote: You don't say, but I assume you're on Windows since you mention GetFileVersionInfo (which doesn't have anything to do with media files, by the way) and WMA. There may be packages out there to do all th

Re: Question regarding re module

2008-06-05 Thread Tim Golden
Paul McGuire wrote: On Jun 5, 7:11 am, Tomohiro Kusumi <[EMAIL PROTECTED]> wrote: It could be that the result overloads the __getattr__-method to delegate calls to some object. Thus it's not part of the outer instance. Didn't I read that Py3 will support a __dir__ method so that classes *could

Re: How to remove read-only from a file

2008-06-06 Thread Tim Golden
Robert Dailey wrote: Hi, Using Python 3.0, how can I remove a read-only property from a file in Windows XP? Thanks. import os import stat os.chmod ("c:/temp/temp.txt", stat.S_IWRITE) (Haven't actually checked that on Python 3.0 but I don't believe it's changed...) TJG -- http://mail.python.

Re: Python doesn't understand %userprofile%

2008-06-10 Thread Tim Golden
[EMAIL PROTECTED] wrote: In xp when I try os.path.getmtime("%userprofile/dir/file%") Python bites back with "cannot find the path specified" Since my script has to run on machines where the username is unspecified I need a fix. Well I can see a few problems here. First is that putting percent

Re: Python doesn't understand %userprofile%

2008-06-10 Thread Tim Golden
[EMAIL PROTECTED] wrote: On Jun 10, 2:09 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: In xp when I try os.path.getmtime("%userprofile/dir/file%") Python bites back with "cannot find the path specified" Since my script has to run on machines where the username is unspecif

Re: How to set directory in save as combo box

2008-06-12 Thread Tim Golden
gopal mishra wrote: In 'save as' dialog of window application, I am trying to set the path in 'save in' combo box using python win32 programming. How we can set the directory in the 'save in' combo box. There are several ways to display a "Save As" dialog. Can you post [a minimal version of]

Re: suppress opening command window after using os.system command

2008-06-12 Thread Tim Golden
Gabriel Genellina wrote: En Thu, 12 Jun 2008 07:08:00 -0300, boriq <[EMAIL PROTECTED]> escribió: On 12 Jun., 11:51, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Thu, 12 Jun 2008 05:28:13 -0300, boriq <[EMAIL PROTECTED]> escribió: > I'm using in my script command os.system('command') o

Re: How to set directory in save as combo box

2008-06-13 Thread Tim Golden
Couple of things, Gopal, which you might want to remember when posting to mailing lists etc. One is that it's *much* better (and more considerate) to post in plain text, not in HTML. (You should be able to tell Outlook to use plain text). *Especially* when posting code. And even *more* especiall

Re: CSV variable seems to reset

2008-06-18 Thread Tim Golden
marc wyburn wrote: Hi, I'm using the CSV module to parse a file using whitelistCSV_file = open("\\pathtoCSV\\whitelist.csv",'rb') whitelistCSV = csv.reader(whitelistCSV_file) for uname, dname, nname in whitelistCSV: print uname, dname, nname The first time I run the for loop the conte

Re: urllib (54, 'Connection reset by peer') error

2008-06-18 Thread Tim Golden
[EMAIL PROTECTED] wrote: Thanks for the help. The error handling worked to a certain extent but after a while the server does seem to stop responding to my requests. I have a list of about 7,000 links to pages I want to parse the HTML of (it's basically a web crawler) but after a certain number

Re: pyTTS says, '"SAPI" not supported'

2008-06-23 Thread Tim Golden
weheh wrote: I'm running Python 2.3 and calling pyTTS. I've had it working forever. Today, I ran out of disk space. After deleting some of my personal files, for no apparent reason, pyTTS no longer runs. For the statement tts = pyTTS.Create() I get the error message: ValueE

Re: String question

2008-06-23 Thread Tim Golden
Andreu wrote: I want to split a sentence and assign each word to a variable. In Ruby I can do it as: v1,v2,v3,v4,v5 = str1.split Which will be the Python equivalent ? Thanks. That would be: str1 = "The quick brown fox jumps" v1, v2, v3, v4, v5 = str1.split () TJG -- http://mail.python.org/m

Re: Using Python and MS-SQL Server

2008-06-23 Thread Tim Golden
[EMAIL PROTECTED] wrote: I have programmed before, but I am new to using Python. I am currently using the ArcGIS software which uses Python as its scripting language for automating tasks. The current script that I am working on requires pulling in some information from a Microsoft SQL Server.

Re: Terminating processes on Windows (handles and IDs)

2008-06-24 Thread Tim Golden
(There must be one down there somewhere, surely?) Sorry for rambling a bit, am confused. Regards, Geoff Bache My way to do it is using excellent wmi module by Tim Golden, which relies on Mark Hammond's pywin32 and Windows native wmi functionality. Here is the link - http://tgolden.sc.sabr

Re: Windows process ownership trouble

2008-06-25 Thread Tim Golden
geoffbache wrote: Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") This produces the following excepti

Re: Windows process ownership trouble

2008-06-25 Thread Tim Golden
geoffbache wrote: Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") Forgot to say: slightly awkward, b

Re: Windows process ownership trouble

2008-06-26 Thread Tim Golden
geoffbache wrote: Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py", line 12, in os.remove ("filena

Re: Windows process ownership trouble

2008-06-26 Thread Tim Golden
geoffbache wrote: Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py", line 12, in os.remove ("filena

Re: Windows process ownership trouble

2008-06-26 Thread Tim Golden
Tim Golden wrote: geoffbache wrote: Tim, Unfortunately my previous message was premature, it seems your workaround doesn't work either on my system (Windows XP, Python 2.5.1) I get the following printed out Traceback (most recent call last): File "C:\TextTest\processown.py&quo

Re: Working with the Windows Registry

2008-06-27 Thread Tim Golden
teh_sAbEr wrote: Great! It works properly now but I have one more question, would anyone know how to get the changes to take effect immediately? Like some sort of Python way to force the desktop to reload? AFAIK the only way that'll happen is if I use the Display Properties dialog box. The Regist

Re: shorten path to files

2008-06-27 Thread Tim Golden
On 2008-06-27, cesco <[EMAIL PROTECTED]> wrote: Hi, I need to retrieve the content of some files which are placed on a network drive so in order to open them I need the full path to the file. Unfortunately some times the path is longer than 256 characters and in Windows such a path is too long w

Re: Win32.client, DAO.DBEngine and exceeding the file sharing count lock

2008-07-02 Thread Tim Golden
Iain King wrote: Hi. I'm using the win32 module to access an Access database, but I'm running into the File Sharing lock count as in http://support.microsoft.com/kb/815281 The solution I'd like to use is the one where you can temporarily override the setting using (if we were in VB): DAO.DBEng

Re: Win32.client, DAO.DBEngine and exceeding the file sharing count lock

2008-07-02 Thread Tim Golden
Iain King wrote: On Jul 2, 3:29 pm, Tim Golden <[EMAIL PROTECTED]> wrote: Iain King wrote: Hi. I'm using the win32 module to access an Access database, but I'm running into the File Sharing lock count as inhttp://support.microsoft.com/kb/815281 The solution I'd like to

Re: Win32.client, DAO.DBEngine and exceeding the file sharing count lock

2008-07-02 Thread Tim Golden
In case it helps, there's a recipe just shown up on the Python Cookbook which at least illustrates DAO use: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/572165 TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: better way to search the Python archive

2008-07-04 Thread Tim Golden
Jeremy Link wrote: Just an FYI out to folks that want a better way to search the Python archive… I’ve been using MarkMail (www.markmail.org ) to search the archives and it works MUCH better than the Google archive. It is a free hosting of all sorts of GNU/open source

Re: win32com.client (Howto edit Contacts in Outlook)

2008-07-04 Thread Tim Golden
Bill Davy wrote: I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code --- hey! that looks familiar :) which enabled me to the contacts at least list. I

Re: Recursive wildcard file search

2008-07-04 Thread Tim Golden
[sorry; this got stuck in my outbox] Robert Dailey wrote: Is there a way to perform a recursive file search using wildcards in python 3.0b1? For example, if I have: C:\foo\abc*xyz.* I want all files in C:\foo and all subfolders (recursively) of C:\foo that match the wildcard abc*xyz.* to be

Re: Can't get Python for Windows to run

2008-07-04 Thread Tim Golden
Tim Rowe wrote: I have Python 2.5 working just fine on my system. I've tried downloading and installing the MS Windows Python extensions, but can't get pythonw.exe (that's the windows executable, right?) to do anything. I double-click it, nothing happens. I run it from a command prompt, it just

Re: python mysteriously halts

2008-07-07 Thread Tim Golden
Todd wrote: I ran a python script last night which connects to a matlab automation server via DCOM (using win32com). I expected to see the results when I came in this morning. But apparently, not long after I left, python stopped. I hit enter in the console, and it started again. Symptomati

Re: how to recognize IE window already opened using win32com extension

2008-07-07 Thread Tim Golden
korean_dave wrote: How do I use the win32com API to manipulate IE windows ALREADY open? ie = Dispatch("InternetExplorer.Application") opens a new window. But I'd like to be able to find, of windows already open, a specific window (with a specified property, matching url, etc.) I have this str

Re: Newbie question

2008-07-09 Thread Tim Golden
A.T.Hofkamp wrote: On 2008-07-09, |e0 <[EMAIL PROTECTED]> wrote: So, i can't use wmi module on linux? On Wed, Jul 9, 2008 at 9:14 AM, Lamonte Harris <[EMAIL PROTECTED]> wrote: I think the win32 module is only for windows. Welcome to the world outside MS. Many python modules don't actually

Re: Newbie question

2008-07-09 Thread Tim Golden
|e0 wrote: I did not mean to use WMI on linux, but query win machines *from* linux. Thank you for your clarifications In principle you ought to be able to use some kind of DCOM bridge (since WMI access if via COM/DCOM). I've no idea if anyone's attempted this or even if all the pieces are in pl

Re: Allow tab completion when inputing filepath?

2008-07-09 Thread Tim Golden
Keith Hughitt wrote: I've been looking around on the web for a way to do this, but so far have not come across anything for this particular application. I have found some ways to enable tab completion for program-related commands, but not for system filepaths. This would be nice to have when prom

Re: Allow tab completion when inputing filepath?

2008-07-10 Thread Tim Golden
Keith Hughitt wrote: On Jul 9, 10:18 am, Tim Golden <[EMAIL PROTECTED]> wrote: Keith Hughitt wrote: I've been looking around on the web for a way to do this, but so far have not come across anything for this particular application. I have found some ways to enable tab completion

Re: win32com.client (Howto edit Contacts in Outlook)

2008-07-10 Thread Tim Golden
Bill Davy wrote: I'm not sure OL2003 can read news. I think perhaps some later OL can (added tot he View menu, perhaps?). So I use OL Express to read news. The OL with which I wish to communicate is: Application name Outlook Version 11.0 Build 8217 Product ID 70141-700-0350904-56905 Languag

Re: Python / Windows process control

2008-07-10 Thread Tim Golden
Salim Fadhley wrote: Does anybody know of a python module which can do process management on Windows? The sort of thing that we might usually do with taskmgr.exe or process explorer? For example: * Kill a process by ID * Find out which process ID is locking an object in the filesystem * Find ou

Re: Local User Control

2008-07-10 Thread Tim Golden
Sparky wrote: I don't know how feasible this is, but is it possible to have users log in to access a local database file in such a way that allows the program to know what user name and password they logged in with? This would involve separate user names and passwords for each user. Well, this

Re: Local User Control

2008-07-10 Thread Tim Golden
Sparky wrote: On Jul 10, 9:58 am, Tim Golden <[EMAIL PROTECTED]> wrote: Sparky wrote: I don't know how feasible this is, but is it possible to have users log in to access a local database file in such a way that allows the program to know what user name and password they logged in

Re: importing .dll in a python file

2008-07-11 Thread Tim Golden
moijes12 wrote: I need to use a .dll from a python script.I have installed pywin.But in the program ,which is like: import dllName I get : Import Error : DLL not found Please suggest a solution! Well, the short answer is: use the ctypes module. The longer answer is: read around the subjec

Re: win32com.client (Howto edit Contacts in Outlook)

2008-07-11 Thread Tim Golden
Bill Davy wrote: and since then have been busy with work, and my other job, and the garden. Aha! So you're English, are you? Looks like you're in the West Country. Weather map suggests you're not short of rain over there :) Now I am back looking at this (and using WInUSB to talk to a Maxim 342

Re: win32com.client (Howto edit Contacts in Outlook)

2008-07-11 Thread Tim Golden
Bill Davy wrote: Traceback (most recent call last): File "H:/Personal/OutlookIF1/t2.py", line 18, in outlook = win32com.client.gencache.EnsureDispatch ("Outlook.Application") File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line 536, in EnsureDispatch mod = EnsureM

Re: About wmi

2008-07-14 Thread Tim Golden
codec can't decode byte 0xb7 in position 14: ordinal not in range(128) [... snip code ...] You should probably post this to comp.python.windows. Tim Golden (author of WMI interface) monitors that list religously (thanks Tim). Actually, I follow this one pretty much, too. I've just

Re: Zipping files

2008-07-15 Thread Tim Golden
dp_pearce wrote: Hi all, I have come across an error while using zipfile and I can't seem to find somewhere that explains the problem. My script needs to be able to take text files from one drive and add them to zip files on another drive. The following seems to work just fine. import zipfile

Re: How can I save command prompt screen

2008-07-15 Thread Tim Golden
Ty hensons wrote: how can i save my command prompt screen? (Trying to be helpful here...) What do mean by "save" and what do you mean by "command prompt screen"? And, especially, what platform are you running on? TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-15 Thread Tim Golden
patrol wrote: Situation (2): result = new_process.terminate() File "C:\Python25\lib\wmi.py", line 494, in __getattr__ handle_com_error (error_info) File "C:\Python25\lib\wmi.py", line 190, in handle_com_error raise x_wmi, "\n".join (exception_string) UnicodeDecodeError: 'ascii' co

Re: About wmi

2008-07-15 Thread Tim Golden
patrol wrote: Situation (1): result = new_process.terminate() TypeError: 'int' object is not callable I'm not sure exactly what's causing that particular effect, but I would suggest that you call the method as .Terminate (note the initial capital). On my box, calling .terminate simply raise

Re: Zipping files

2008-07-15 Thread Tim Golden
dp_pearce wrote: When I saw "Permission denied", this was my suspicion. And I think you are very right. I have just gone back and tried writing to a file outside of C:, in this case C:/output/, and it seems to work again. Would I be right in guessing there is no way around this? Well, you coul

Re: need ldap windows binary and/or installation help

2008-07-15 Thread Tim Golden
Sells, Fred wrote: I'm running python 2.5 (or 2.4) in an XP environment. I downloaded and installed the .dll's from OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in c:/windows/system32 as instructed now I get this error. Is there anyway to avoid building the python_ldap b

Re: File Locking Forced? Newbie question.

2008-07-15 Thread Tim Golden
Sparky wrote: Hello! I am writing some software that will have many users accessing the same file resource at once for reading purposes only. I am programming on (Ubuntu) Linux and my question is in Windows, can I have it so that the same file can be open in read mode by more than one person or c

<    7   8   9   10   11   12   13   14   15   16   >