PythonWin problems

John Roth newsgroups at jhrothjr.com
Wed Dec 31 18:58:35 EST 2003


"Colin J. Williams" <cjw at sympatico.ca> wrote in message
news:z5GIb.10324$Vl6.2031681 at news20.bellglobal.com...
> PythonWin has been my favourite IDE for quite a while.
>
> When one right clicks on a .py file in the Windows Explorer, among the
> options are Open and Edit.  The former is the default and executes
> Python, with the selected script.  The latter activates the PythonWin
> editor, with the selected script.
>
> Since, most frequently, I wish to edit the script, or execute it with
> the debugger, I tried changing the default to Edit, using the Edit File
> Type menu.
>
> Unfortunately, this leads to a couple of problems:
>
> 1. Any activity becomes horrendously slow, and
> 2. The following message appears:
>     LoadBarState failed - LoadBarState failed (with win32 exception!)
> [Dbg]>>>
>
> Does anyone have a workaround suggestion?

You're going to have to get down and dirty with the registry, I'm
afraid.

This is the way my registry looks for Python 2.2 (I don't have
2.3 installed yet.) This is in registry patch format which is
imported and exported by regedit.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File]

@="Python File"

[HKEY_CLASSES_ROOT\Python.File\AutoRegister]

@="C:\\WINDOWS\\System32\\PythonCOM22.dll"

[HKEY_CLASSES_ROOT\Python.File\DefaultIcon]

@="C:\\PROGRA~1\\PYTHON22\\Py.ico"

[HKEY_CLASSES_ROOT\Python.File\shell]

[HKEY_CLASSES_ROOT\Python.File\shell\Edit]

[HKEY_CLASSES_ROOT\Python.File\shell\Edit\command]

@="C:\\PROGRA~1\\PYTHON22\\lib\\site-packages\\Pythonwin\\pythonwin.exe
/edit \"%1\""

[HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE]

[HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command]

@="C:\\PROGRA~1\\PYTHON22\\pythonw.exe
C:\\PROGRA~1\\PYTHON22\\Tools\\idle\\idle.pyw -e \"%1\""

[HKEY_CLASSES_ROOT\Python.File\shell\open]

[HKEY_CLASSES_ROOT\Python.File\shell\open\command]

@="C:\\PROGRA~1\\PYTHON22\\python.exe \"%1\" %*"

[end of registry patch]

Restore yours to look something like this (and make sure you
don't put my values into your system - they probably won't work!)

Once you do that, change (or add) the default value of the

[HKEY_CLASSES_ROOT\Python.File\shell]

key to say "Edit".

That's all there is to it. Remember to back up your registry
first, or at least save the key your playing with.

If you're reluctant to get that close to the registry,
there are a large number of resources on the net,
and I heartily recommend "Windows XP annoyances"
by David Karp (O'Reilly). The information on file types and
associations is the same for all Windows versions.

John Roth

>
> Thanks.
>
> Colin W.
>





More information about the Python-list mailing list