Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Activating `-i' from inside a script?

Reply
Thread Tools

Activating `-i' from inside a script?

 
 
=?iso-8859-1?q?Fran=E7ois_Pinard?=
Guest
Posts: n/a
 
      06-27-2003
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

 
Reply With Quote
 
 
 
 
Fernando Perez
Guest
Posts: n/a
 
      06-27-2003
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
 
Reply With Quote
 
 
 
 
Fernando Perez
Guest
Posts: n/a
 
      07-01-2003
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activating both A + G Wireless Channels =?Utf-8?B?YnJlbnRyb21lcm8=?= Wireless Networking 2 11-02-2005 01:34 AM
2732 Activating expired training material on retail version of VPC =?Utf-8?B?c3BpbmZpeGxpeg==?= Microsoft Certification 1 09-01-2005 02:56 PM
activating encryptiong causes device to be hidden from workgroup Keyser Wireless Networking 1 05-10-2005 02:36 PM
Re: Activating `-i' from inside a script? Bob Gailer Python 0 06-27-2003 03:07 PM
Re: Activating `-i' from inside a script? Fredrik Lundh Python 3 06-27-2003 11:49 AM



Advertisments