terminate exectutioin in PythonWin

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim

    #1

    terminate exectutioin in PythonWin

    Hi all

    1.Could someone tell me how to terminate execution in PythonWin?

    2.Can anyone recommend a free development environment in which you can
    save your workspace (e.g. open files, debugging breakpoints etc.)

    Jim
  • Larry Bates

    #2
    Re: terminate exectutioin in PythonWin

    1) To exit any application:

    import sys
    sys.exit(0)

    2) I'm not familiar with any of these development systems. I use
    what comes with ActiveState's PythonWin. It does have debugging
    breakpoints, etc.

    Larry Bates

    Jim wrote:[color=blue]
    > Hi all
    >
    > 1.Could someone tell me how to terminate execution in PythonWin?
    >
    > 2.Can anyone recommend a free development environment in which you can
    > save your workspace (e.g. open files, debugging breakpoints etc.)
    >
    > Jim[/color]

    Comment

    • Jim

      #3
      Re: terminate exectutioin in PythonWin

      Larry Bates wrote:[color=blue]
      > 1) To exit any application:
      >
      > import sys
      > sys.exit(0)[/color]

      ....



      Thanks Larry.

      Actually I meant how do I stop a program running that I have started in
      the interpreter. If I get into an infinite loop I can't stop it without
      qutting PythonWin.

      Then I have to open all the files and re-insert breakpoints etc. :(

      Jim

      Comment

      • Neil Hodgson

        #4
        Re: terminate exectutioin in PythonWin

        Jim,
        [color=blue]
        > 1.Could someone tell me how to terminate execution in PythonWin?[/color]

        Use the "Break into running code" command on the context menu of the
        PythonWin icon in the bottom right of the taskbar.

        Neil

        Comment

        • Jim

          #5
          Re: terminate exectutioin in PythonWin

          Neil Hodgson wrote:[color=blue]
          > Jim,
          >
          >[color=green]
          >>1.Could someone tell me how to terminate execution in PythonWin?[/color]
          >
          >
          > Use the "Break into running code" command on the context menu of the
          > PythonWin icon in the bottom right of the taskbar.
          >
          > Neil[/color]

          Great thanks! PythonWin isn't hot on keyboard shortcuts but ironically
          calls this a KeyboardInterru pt :|

          Know any keyboard shortcuts for debug view? e.g. open it, run(debug),
          step etc.

          Jim

          Comment

          • Steve Holden

            #6
            Re: terminate exectutioin in PythonWin

            Jim wrote:
            [...][color=blue]
            >
            > Actually I meant how do I stop a program running that I have started in
            > the interpreter. If I get into an infinite loop I can't stop it without
            > qutting PythonWin.
            >
            > Then I have to open all the files and re-insert breakpoints etc. :(
            >
            > Jim[/color]

            Look in the system tray! Right-mouse on the Python and select "break
            into running program".

            regards
            Steve


            --
            Steve Holden +1 703 861 4237 +1 800 494 3119
            Holden Web LLC http://www.holdenweb.com/
            Python Web Programming http://pydish.holdenweb.com/

            Comment

            • Jim

              #7
              Re: terminate exectutioin in PythonWin

              Steve Holden wrote:[color=blue]
              > Jim wrote:
              > [...]
              >[color=green]
              >>
              >> Actually I meant how do I stop a program running that I have started
              >> in the interpreter. If I get into an infinite loop I can't stop it
              >> without qutting PythonWin.
              >>
              >> Then I have to open all the files and re-insert breakpoints etc. :(
              >>
              >> Jim[/color]
              >
              >
              > Look in the system tray! Right-mouse on the Python and select "break
              > into running program".
              >
              > regards
              > Steve
              >
              >[/color]
              D'oh. I didn't think of that.

              Thanks

              Jim

              Comment

              • olsongt@verizon.net

                #8
                Re: terminate exectutioin in PythonWin

                [color=blue][color=green]
                > >
                > >[/color]
                > D'oh. I didn't think of that.
                >
                > Thanks
                >
                > Jim[/color]

                A little off-topic, but here's a little more fun with pythonwin. You
                can spawn the debugging environment from a normal python script running
                outside of pythonwin with:

                import pywin.debugger; pywin.debugger. set_trace()

                Also note that 'pywin.debugger .set_trace()' can be used anywhere if
                you're trying to 'keep' breakpoints in the code without relying an an
                IDE or project tracking them for you.

                Comment

                • Neil Hodgson

                  #9
                  Re: terminate exectutioin in PythonWin

                  Jim:
                  [color=blue]
                  > Great thanks! PythonWin isn't hot on keyboard shortcuts but ironically
                  > calls this a KeyboardInterru pt :|[/color]

                  I don't think the keyboard can be accessed in this situation so the
                  icon is provided.
                  [color=blue]
                  > Know any keyboard shortcuts for debug view? e.g. open it, run(debug),
                  > step etc.[/color]

                  No, I use PythonWin just as a console and prefer HAP Debugger
                  although it hasn't been updated for Python 2.4.


                  Neil

                  Comment

                  Working...