Francesco Guerrieri wrote:
>  
> Yes I'm aware that it is not a python-related problem but rather a
> COM-related problem... simply I never wrote a com server in c++
> (actually I have just begun to code under win).
> Wouldn't it be possible to call something like
> xl = win32com.client.dispatch("Excel.Application")
> xl.CoFreeUnusedLibraries()
> ??
> that would be the solution to the problem. I am sure that it is not
> possible, since you don't mention it :-) do you know why it isn't?

No, it's not possible.  CoFreeUnusedLibraries is a Windows API that
Excel must call.  It is not a method in the Excel object model.


> for instance I have found the method COMAddIns.Update which has a nice
> name. Do you know if it could be useful? In the meanwhile I will try
> to find its effect on the msdn site...

Don't know.


>     Remember that the problem you describe only occurs during development,
>     and we developers are used to being inconvenienced.  Once your server
>     stabilizes, you will be happy that the instance keeps running, so you
>     don't have to pay the penalty of invoking the interpreter each time.
>
>  
> ok it's not a terrible inconvenience, but it has a bad effect on my
> code. For instance if I have three modules,
>  
> server.py which imports module1.py and module2.py
>  
> and if I change something, I must rename the corresponding AND change
> the name which I am importing. This is unpractical, and I am solving
> it by putting everything in the same .py. This is not a problem given
> the fact that the server is small, but it would be a problem if I had
> a larger python application and I decided to wrap a COM server around
> it...

Now, THIS problem may be solvable.  Remember that Python supports the
"reload" function that forces it to reload a new version of an imported
module.  It can't change any objects that have already been created, but
it may be able to help you with this specific problem.  You would have
to write your main server in such a way that you could signal it to
reload modules, but that's a solvable problem.

-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to