Re: [python-win32] imp.load_module problem

2009-01-08 Thread Mark Hammond
On 9/01/2009 7:46 AM, Adam Pletcher wrote: imp.load_module(modName, None, modulePath, ('.dll', 'rb', imp.C_EXTENSION)) ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detai

[python-win32] Get file MIME and suggested apps

2009-01-08 Thread piotr maliƄski
Hi I have to get a file MIME type (better than python contentypes module), and get a list of applications that can open given file (or the default one). I've looked at few win32 modules, and I didn't found anything that could help me (GetBinaryType. GetFileAttributes, GetFileType). Can this be done

[python-win32] imp.load_module problem

2009-01-08 Thread Adam Pletcher
We've created a Windows app with an embedded Python interpreter (2.6.1). The deployment includes the files for pywin32 on both x86 Release and Debug builds. Since pywin32 isn't formally installed, I found it necessary to manually import a couple modules at startup before others would import corre

Re: [python-win32] python print statements

2009-01-08 Thread Vernon Cole
Well, you can't keep Python from _executing_ the print statements, but you can keep it from displaying the results. Any python object which has a "write" method can be used as target for the "print" statement, so... def test(n): for i in range(n): print 'I is =', i class blackHole(obj

Re: [python-win32] python print statements

2009-01-08 Thread David Robinow
On Thu, Jan 8, 2009 at 1:12 PM, Nalli Dinesh wrote: > I do not want to remodel my application at this stage. I have print > statements all over the place. I looking at a solution where, without > touching the print statements at all, I want to tell the python interpreter > to not execute print sta

Re: [python-win32] python print statements

2009-01-08 Thread King Simon-NFHD78
I don't think anyone's mentioned the python logging package, which is good for general purpose logging. However, since you want to do this without changing all your print statements: In Python 2.x, you can probably reassign sys.stdout. As long as you aren't outputting anything else to stdout, this

Re: [python-win32] python print statements

2009-01-08 Thread Nalli Dinesh
Thanks Vernon, Jim, Micheal. I kind of knew the different ways of modelling any python application as you guys have described in your email. I appreciate your inputs though. But I am looking for a different solution. Here is what I am looking at - I do not want to remodel my application at this

Re: [python-win32] python print statements

2009-01-08 Thread Vernon Cole
How about -- if debug: print x or, in a more complex setting, have a "verbose" attribute in each module and -- if self.verbose > 2: print x # so you can have levels of debug printouts ?? -- Vernon Cole On Wed, Jan 7, 2009 at 11:30 PM, Michel Claveau wrote: > Hi! > > 1) Define your print fun

Re: [python-win32] problem in getting handle to submenu of a window's menu

2009-01-08 Thread Madhubala
Hi, I am trying to access submenu of a menu of a window using win32api .I even tried using win32api in 'c' programming. In both attempts I was not successful. The details are - There is an application which starts three processes when we create process with the main application(*.exe). Al