PythonWin problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Colin J. Williams

    PythonWin problems

    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?

    Thanks.

    Colin W.

  • John Roth

    #2
    Re: PythonWin problems


    "Colin J. Williams" <cjw@sympatico. ca> wrote in message
    news:z5GIb.1032 4$Vl6.2031681@n ews20.bellgloba l.com...[color=blue]
    > 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?[/color]

    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_RO OT\Python.File]

    @="Python File"

    [HKEY_CLASSES_RO OT\Python.File\ AutoRegister]

    @="C:\\WINDOWS\ \System32\\Pyth onCOM22.dll"

    [HKEY_CLASSES_RO OT\Python.File\ DefaultIcon]

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

    [HKEY_CLASSES_RO OT\Python.File\ shell]

    [HKEY_CLASSES_RO OT\Python.File\ shell\Edit]

    [HKEY_CLASSES_RO OT\Python.File\ shell\Edit\comm and]

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

    [HKEY_CLASSES_RO OT\Python.File\ shell\Edit with IDLE]

    [HKEY_CLASSES_RO OT\Python.File\ shell\Edit with IDLE\command]

    @="C:\\PROGRA~1 \\PYTHON22\\pyt honw.exe
    C:\\PROGRA~1\\P YTHON22\\Tools\ \idle\\idle.pyw -e \"%1\""

    [HKEY_CLASSES_RO OT\Python.File\ shell\open]

    [HKEY_CLASSES_RO OT\Python.File\ shell\open\comm and]

    @="C:\\PROGRA~1 \\PYTHON22\\pyt hon.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_RO OT\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
    [color=blue]
    >
    > Thanks.
    >
    > Colin W.
    >[/color]


    Comment

    • R.Marquez

      #3
      Re: PythonWin problems

      The bug you are experiencing has been posted already in the "Python
      for Windows Extensions" since 2003-08-08. See:


      Also, a workaround was posted by another user on 2003-09-10. See:


      Why this has not been fixed yet is a good question.

      -Ruben

      "Colin J. Williams" <cjw@sympatico. ca> wrote in message news:<z5GIb.103 24$Vl6.2031681@ news20.bellglob al.com>...[color=blue]
      > 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?
      >
      > Thanks.
      >
      > Colin W.[/color]

      Comment

      • r.e.s.

        #4
        Re: PythonWin problems

        "Colin J. Williams" <cjw@sympatico. ca> wrote ...[color=blue]
        > 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.[/color]

        FWIW ...

        I'm not sure what you mean by "Edit File Type menu".
        Using WinXP Pro, in Windows Explorer I went to
        Tools/Folder Options/File Types
        selected PY, clicked Advanced, and set the default to Edit.
        Now double-clicking a .py file brings it up in PythonWin,
        and I've experienced neither of the problems that you report below.
        [color=blue]
        >
        > 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]>>>[/color]

        Comment

        • Colin J. Williams

          #5
          Re: PythonWin problems

          r.e.s. wrote:[color=blue]
          > "Colin J. Williams" <cjw@sympatico. ca> wrote ...
          >[color=green]
          >>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.[/color]
          >
          >
          > FWIW ...
          >
          > I'm not sure what you mean by "Edit File Type menu".
          > Using WinXP Pro, in Windows Explorer I went to
          > Tools/Folder Options/File Types
          > selected PY, clicked Advanced, and set the default to Edit.[/color]
          I thought of this activity as editing.[color=blue]
          > Now double-clicking a .py file brings it up in PythonWin,
          > and I've experienced neither of the problems that you report below.
          >
          >[color=green]
          >>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]>>>[/color]
          >[/color]
          Many thanks to those who responded.

          I used the ideas of John Roth and modified my XP registry, using
          Registrar-Lite, to read:

          REGEDIT4

          [HKEY_CLASSES_RO OT\Python.File]
          @="Python File"
          "EditFlags"=dwo rd:00000000
          "BrowserFlags"= dword:00000008

          [HKEY_CLASSES_RO OT\Python.File\ AutoRegister]
          @="C:\\WINDOWS\ \System32\\Pyth onCOM23.dll"

          [HKEY_CLASSES_RO OT\Python.File\ DefaultIcon]
          @="C:\\PYTHON23 \\Py.ico"

          [HKEY_CLASSES_RO OT\Python.File\ shell]
          @="Edit"

          [HKEY_CLASSES_RO OT\Python.File\ shell\Edit]

          [HKEY_CLASSES_RO OT\Python.File\ shell\Edit\comm and]
          @="C:\\Python23 \\pythonwin.exe /edit \"%1\""

          [HKEY_CLASSES_RO OT\Python.File\ shell\Edit with IDLE]

          [HKEY_CLASSES_RO OT\Python.File\ shell\Edit with IDLE\command]
          @="C:\\Python23 \\Pythonw.exe C:\\Python23\\L ib\\idlelib\\id le.pyw -e \"%1\""

          [HKEY_CLASSES_RO OT\Python.File\ shell\open]

          [HKEY_CLASSES_RO OT\Python.File\ shell\open\comm and]
          @="C:\\PYTHON23 \\python.exe \"%1\" %*"

          All functions well now.

          Thanks.

          Colin W.



          Comment

          Working...