[python-win32] How to replace the values with keys ?

2008-07-22 Thread Graps Graps
Hi all, I am a newbie to python... I have two text files text1 and text2. Text1 is a tabbed separated file, say like a b a c a d a g b c b d b h c d c h... and so on.. Text2 is a python dictionary containing data as {0: 'a', 1: 'b', 2: 'c'...} now I want the data in text1 to be replaced with

[python-win32] com_error Unicode problems

2008-07-22 Thread Tim Golden
There's a thread over on c.l.py which concerns the error messages returned from the WMI module, which uses win32com.client and all its works and promises... http://mail.python.org/pipermail/python-list/2008-July/499172.html The OP is running on a Simple Chinese edition of Windows XP, and the

Re: [python-win32] How to replace the values with keys ?

2008-07-22 Thread Larry Bates
Graps Graps wrote: Hi all, I am a newbie to python... I have two text files text1 and text2. Text1 is a tabbed separated file, say like a b a c a d a g b c b d b h c d c h... and so on.. Text2 is a python dictionary containing data as {0: 'a', 1: 'b', 2: 'c'...} now I want the data in

[python-win32] MSMQ - cannot catch COM_ERROR withpythoncom.com_error

2008-07-22 Thread Lynton Grice
Hi there, Please help me ;-) I know how to push / pop messages off of a MSMQ, also how to create a queue etc.but my problem is I cannot seen to catch the com_error when I try create a MSMQ that already exists ;-( The basic code is as follows: import win32com.client import pythoncom import

Re: [python-win32] MSMQ - cannot catch COM_ERROR withpythoncom.com_error

2008-07-22 Thread Tim Golden
Lynton Grice wrote: Please help me ;-) I know how to push / pop messages off of a MSMQ, also how to create a queue etc.but my problem is I cannot seen to catch the com_error when I try create a MSMQ that already exists ;-( The basic code is as follows: import win32com.client import

Re: [python-win32] How to replace the values with keys ?

2008-07-22 Thread Tim Roberts
Graps Graps wrote: Hi all, I am a newbie to python... I have two text files text1 and text2. Text1 is a tabbed separated file, say like a b a c a d a g b c b d b h c d c h... and so on.. Text2 is a python dictionary containing data as {0: 'a', 1: 'b', 2: 'c'...} now I want the data in

Re: [python-win32] How to replace the values with keys ?

2008-07-22 Thread Graps Graps
Hi all, I tried import aDict import re infile = open('text1.txt','rw') outfile = open('text3.txt','w') def replace_words(infile, aDict): rc=re.compile('|'.join(map(re.escape, aDict))) def translate(match): return aDict[match.group(0)] return rc.sub(translate, infile)

[python-win32] 32bit python on x64 bit machine cannot access registry

2008-07-22 Thread siddhartha veedaluru
Hello i cannot access some of the values from registry using 32bit python on x64bit machine i need to install 32bit because i couldn't get x64bit pyodbc module. Can anyone know where can i get the x64 version pyodbc. or solution to the above problem. thanks Siddhartha