Tim Roberts wrote:

>Gertjan Klein wrote:
>>(I want to make a launcher for
>> command prompts, so I can open a command prompt at a given directory
>> with appropriate settings for python: path, C compiler, etc.)
>
>Interesting!  I wrote basically that same extension (in C++) about 5
>years ago.

I have been thinking about trying this for years now. ;-)  There is not
much information on how to do this with Python out there, which has
stopped me so far. (Or perhaps my Google skills just failed me.)

>> 1) Is it possible to completely unload the shell extension, so that
>> registering it again gets me the newer version? I'd rather not reboot
>> after every code change.
>
>Yes, it is possible, but you have to restart the root Windows Explorer
>shell.  You can bring up the Task Manager and kill the Explorer
>process.  All of your icons and your start bar will briefly disappear,
>but Windows is stubborn and will immediately restart it.

It doesn't over here, but another poster has shown me how to circumvent
this. If this is the only way to do that I will; there is no way to tell
PyWin32 to reload the extension? (I know reloading in Python is tough,
I'm expecting a "no" here. ;-))

>> 2) I see print statements in the source code, but I have no idea where
>> they go; I checked the event log, but they are not there. Are they
>> logged anywhere? If not, why are they there to begin with?
>>
>> Any other tip on how to effectively debug this stuff would be most
>> welcome as well.
>
>The print statements go into empty space because there is no stdout for
>that process.  You can try using the logging module to log to a file, or
>you can use ctypes to write to kernel32.OutputDebugString and using a
>kernel debug log monitor to read them.

The logging module reminds me of Java too much. :(  I think I'll try to
write to a file, I have no idea if I have a kernel debug log monitor.

I read somewhere that debugging a C++ shell extension is possible under
Visual Studio; can I assume that something like that is not viable when
using Python / PyWin32?

Thanks,
Gertjan.


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

Reply via email to