stop program and start interactive interpreter

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

    stop program and start interactive interpreter


    I seem to remeber reading somewhere there was a statement you could
    put in your python program to stop its execution and start the
    interactive interpreter at that point (and then you could change the
    value of some variables and continue executing). Am I having delusions
    or is there a way to do this?

    Thanks,
    Dave




  • John J. Lee

    #2
    Re: stop program and start interactive interpreter

    Dave Reed <drlinux@columb us.rr.com> writes:
    [color=blue]
    > I seem to remeber reading somewhere there was a statement you could
    > put in your python program to stop its execution and start the
    > interactive interpreter at that point (and then you could change the
    > value of some variables and continue executing). Am I having delusions
    > or is there a way to do this?[/color]

    I think you're right, but don't recall how you do it.

    python -i spam.py

    might be good enough for you, though


    John

    Comment

    • Dave Kuhlman

      #3
      Re: stop program and start interactive interpreter

      Dave Reed wrote:
      [color=blue]
      >
      > I seem to remeber reading somewhere there was a statement you
      > could put in your python program to stop its execution and start
      > the interactive interpreter at that point (and then you could
      > change the value of some variables and continue executing). Am I
      > having delusions or is there a way to do this?
      >
      > Thanks,
      > Dave[/color]

      Take a look at IPython. It provides both an enhanced Python
      command line and an interactive shell that you can call from within
      your Python source code. However, I believe that if you change the
      value of variables, those new values are lost when you exit the
      IPython shell and continue execution.



      The manual is at:



      And the part of the manual about the interactive shell is at:



      Hope this helps.

      (another) Dave

      --
      Dave Kuhlman

      dkuhlman@rexx.c om

      Comment

      Working...