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

2008-07-23 Thread Roger Upole
siddhartha veedaluru wrote: 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

Re: [python-win32] com_error Unicode problems

2008-07-23 Thread niki
Tim Golden wrote: 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

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

2008-07-23 Thread Mark Hammond
i cannot access some of the values from registry using 32bit python on x64bit machine See the article at http://blogs.msdn.com/junfeng/archive/2004/04/05/107433.aspx for an overview of how the registry works in such systems. The short story is that you can combine the value KEY_WOW64_64KEY

Re: [python-win32] com_error Unicode problems

2008-07-23 Thread Tim Golden
niki wrote: Tim Golden wrote: The OP is running on a Simple Chinese edition of Windows XP, and the error message, naturally, returns Simple Chinese characters. But... it's apparent that the com_error info structure returns not Unicode but byte stream. I *think* I can decode into Unicode by

Re: [python-win32] python-win32 Digest, Vol 64, Issue 25

2008-07-23 Thread siddhartha veedaluru
Hi, Tried the following snippet: import os, sys from _winreg import * KEY_WOW64_64KEY = 256 regHandle = OpenKey(HKEY_LOCAL_MACHINE,SOFTWARE\Myapp\Base,0,KEY_WOW64_64KEY) val = QueryValue(regHandle,nPLATTYPE) print val Got the following error Traceback (most recent call last): File

Re: [python-win32] python-win32 Digest, Vol 64, Issue 25

2008-07-23 Thread siddhartha veedaluru
On Wed, Jul 23, 2008 at 4:27 PM, siddhartha veedaluru [EMAIL PROTECTED] wrote: Hi, Tried the following snippet: import os, sys from _winreg import * KEY_WOW64_64KEY = 256 regHandle = OpenKey(HKEY_LOCAL_MACHINE,SOFTWARE\Myapp\Base,0,KEY_WOW64_64KEY) val =

Re: [python-win32] python-win32 Digest, Vol 64, Issue 25

2008-07-23 Thread Norm Petterson
Google is your friend. Of the many references, he first for WindowsError: [Error 5] Access is denied probably answers your question ;-)... On Wed, Jul 23, 2008 at 6:57 AM, siddhartha veedaluru [EMAIL PROTECTED] wrote: Hi, Tried the following snippet: import os, sys from _winreg import

[python-win32] Problem with TLB file and COM

2008-07-23 Thread Reedick, Andrew
I'm having trouble with a COM object for which none of its methods are available at runtime. The COM class is defined in a tlb file. I used makepy -i, added the gencache lines to the program, and can see the methods in the generated file. However, when I try to call any method, it blows up with

[python-win32] FW: MSMQ - cannot catchCOM_ERROR withpythoncom.com_error

2008-07-23 Thread Lynton Grice
Hey Tim, Wow, you are 100% correctthere was something in WingIDE that is not happystrange I ran the same code in the standard interpreter and it caught the error perfectly BTW: What IDE's do you guys use for Python? Thanks a million, have a great day! Lynton -Original

Re: [python-win32] FW: MSMQ - cannot catchCOM_ERROR withpythoncom.com_error

2008-07-23 Thread Mike Driscoll
Lynton Grice wrote: Hey Tim, Wow, you are 100% correctthere was something in WingIDE that is not happystrange I ran the same code in the standard interpreter and it caught the error perfectly BTW: What IDE's do you guys use for Python? Thanks a million, have a great day!

[python-win32] Python and Visual Basic Integration

2008-07-23 Thread Mark Norley
Hi I've got a Python script that outputs a large text file of data and I've recently made a simple GUI for it in Visual Basic (2008). While it's simple enough to launch the Python script and pass it command line parameters from VB using Shell(python etc), I'm wondering how to pass information

[python-win32] how to automate VB fron python

2008-07-23 Thread Emanuel Sotelo
hi, i will like to now if it's posible to automate visual basic and do you do this, i have read that for word you just use Word.Application same case for excel, but i cant get to find how to run visual basic from python, or from a existing program of VB to use one of he class that i create

Re: [python-win32] FW: MSMQ - cannot catch COM_ERROR with pythoncom.com_error

2008-07-23 Thread Tim Roberts
Lynton Grice wrote: Wow, you are 100% correctthere was something in WingIDE that is not happystrange I ran the same code in the standard interpreter and it caught the error perfectly BTW: What IDE's do you guys use for Python? gvim, the World's Greatest Editor, by

Re: [python-win32] Python and Visual Basic Integration

2008-07-23 Thread Tim Roberts
Mark Norley wrote: I've got a Python script that outputs a large text file of data and I've recently made a simple GUI for it in Visual Basic (2008). While it's simple enough to launch the Python script and pass it command line parameters from VB using Shell(python etc), I'm wondering how to

Re: [python-win32] how to automate VB fron python

2008-07-23 Thread Tim Roberts
Emanuel Sotelo wrote: hi, i will like to now if it's posible to automate visual basic and do you do this, i have read that for word you just use Word.Application same case for excel, but i cant get to find how to run visual basic from python, or from a existing program of VB to use one of he

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

2008-07-23 Thread Tim Roberts
Graps Graps wrote: 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

Re: [python-win32] Python and Visual Basic Integration

2008-07-23 Thread Mark Norley
Thanks Tim. Where would I go to find out about setting up my Python script as a COM server? (A for dummies level of instruction is what I'd be looking for :-) On Wed, Jul 23, 2008 at 7:28 PM, Tim Roberts [EMAIL PROTECTED] wrote: Mark Norley wrote: I've got a Python script that outputs a

[python-win32] how to automate VB fron python

2008-07-23 Thread Emanuel Sotelo
hi Tim Roberts, well a have install visual basic 6.0 can you help me by telling me how to make mi VB programa into a COM Server or indicate some web pages that can help me out _ Los mejores conciertos en exclusiva por MSN in

Re: [python-win32] how to automate VB fron python

2008-07-23 Thread Emanuel Sotelo
Tim Roberts wrote: This is kind of the inverse of the last question! Partly, this depends on which version of VB you are using. Your VB program can become a COM server. Once you do that, your Python code can use it, just like Word.Application and Excel.Application. hi Tim Roberts, well a

Re: [python-win32] how to automate VB fron python

2008-07-23 Thread Tim Roberts
Emanuel Sotelo wrote: hi Tim Roberts, well a have install visual basic 6.0 Are you aware that Visual Basic 6.0 is now 10 years old? Software is not like wine and cheese. It does not get better with age. can you help me by telling me how to make mi VB programa into a COM Server or

Re: [python-win32] Python and Visual Basic Integration

2008-07-23 Thread Vernon Cole
E, ummm, (cough)... Wouldn't it be a lot easier to write the GUI in python (perhaps using wxpython?) and simply import and call the (other) python script? Writing text to a notebook page is quite trivial compared to interprocess communications. I can make a sample if you are interested. --

Re: [python-win32] Problem with TLB file and COM

2008-07-23 Thread Mark Hammond
This will be due to the object throwing an incorrect error code when the flag for the method is incorrect, and win32com can't know what the correct flag is ahead of time for dynamic objects. Further, the object doesn't support type info from its typelib at runtime, so Python can't match up the

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

2008-07-23 Thread Graps Graps
Hi all, aDict is a dictionary, containing {0: 'str1\n', 1: 'str22\n', 2: 'str3\n', 3: 'str4\n', 4: 'str5\n', ..., , 1308: 'str1309\n'}. I used: keys = m values = noDupes aDict = dict(zip(keys,values)) to get aDict, where m=range(1309) and noDupes was a list read from a text file.

[python-win32] ctypes and DLL

2008-07-23 Thread Marcus.CM
Hi On Windows/Vista :- vr = ctypes.CDLL(str) When loading a DLL that is corrupted using cytpes, i get a bombed out box with python.exe - bad image as the message box title instead of handling it at my exception handler. How do i do this without the ugly messagebox from python ?