Activating `-i' from inside a script?

Discussion in 'Python' started by =?iso-8859-1?q?Fran=E7ois_Pinard?=, Jun 27, 2003.

  1. Hi, Python friends.

    Is there a way for a script to activate the effect of the `-i' option, that
    is, to force interactive mode once `__main__' has run? For one application,
    I would like that if the application discovers some data discrepancy or
    failure (not a Python error) and only then, and if the application was also
    started from a tty, it gives the user to interactively explore, using
    Python, the context that was built while the run was going.

    --
    François Pinard http://www.iro.umontreal.ca/~pinard
     
    =?iso-8859-1?q?Fran=E7ois_Pinard?=, Jun 27, 2003
    #1
    1. Advertising

  2. François Pinard wrote:

    > Hi, Python friends.
    >
    > Is there a way for a script to activate the effect of the `-i' option, that
    > is, to force interactive mode once `__main__' has run? For one application,
    > I would like that if the application discovers some data discrepancy or
    > failure (not a Python error) and only then, and if the application was also
    > started from a tty, it gives the user to interactively explore, using
    > Python, the context that was built while the run was going.
    >

    François,

    you might want to look at ipython's embedding. Since I know you use ipython,
    there may be a reason why you want something else. I just mention it in case
    you missed it in the docs.

    After checking your trigger condition, an ipshell() call will load ipython in
    the current data context.

    Best,

    f
     
    Fernando Perez, Jun 27, 2003
    #2
    1. Advertising

  3. François Pinard wrote:

    > [Fernando Perez]
    >
    >> Fran?is, you might want to look at ipython's embedding. [...] After
    >> checking your trigger condition, an ipshell() call will load ipython in
    >> the current data context.

    >
    > I did not think about loading `ipython' after the fact. The nice thing
    > about your idea is that my co-workers are already used to IPython, so it
    > would be natural for them to find themselves in that interaction context.
    > Thanks for replying! :)
    >


    Great! Drop me a line to my colorado address or post to the ipython-user if you
    need a hand with this.

    Best,

    f.
     
    Fernando Perez, Jul 1, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Strauss

    Activating JavaScript from C#

    Mike Strauss, Dec 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,964
    Elton Wang
    Dec 20, 2004
  2. Robert Rotstein

    activating a SOAP extension from the client

    Robert Rotstein, Jan 10, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    448
    Robert Rotstein
    Jan 10, 2006
  3. Robert Rotstein

    activating a SOAP extension from a client

    Robert Rotstein, Jan 10, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    335
    Robert Rotstein
    Jan 10, 2006
  4. Fredrik Lundh

    Re: Activating `-i' from inside a script?

    Fredrik Lundh, Jun 27, 2003, in forum: Python
    Replies:
    3
    Views:
    659
    =?iso-8859-1?q?Fran=E7ois_Pinard?=
    Jun 27, 2003
  5. Bob Gailer
    Replies:
    0
    Views:
    646
    Bob Gailer
    Jun 27, 2003
Loading...

Share This Page