473,486 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Activating `-i' from inside a script?

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

Jul 18 '05 #1
2 1597
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
Jul 18 '05 #2
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.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2470
by: Ole Kramer, SFS GmbH | last post by:
We have installed PHP 5.0.1 on a Windows 2003 Server with IIS6 in ISAPI mode. The processing of .php files works fine with our basis version of the php.ini file. But, as soon as we edit the php.ini...
4
2074
by: Bill | last post by:
Is it possible to somehow activate a page containing a php script by sending an email to a mailbox on the server? I have a script that sends out notification emails to an individual. He wants to...
0
2430
by: mrjolly | last post by:
I have VB6 code that creates Excel v8 workbooks/worksheet/controls/macros based upon a text file. I have created a button on a worksheet that activates a piece of code. Unfortunately, the...
4
1476
by: Riko Wichmann | last post by:
dear all, lately, I installed Python 2.3.4 from sources (after having 2.2 for some time). However, running Python interactively, I cannot recall the histroy of command with cursor-up or down...
3
2822
by: niv | last post by:
i have a database, one of the fields is a hyperlink to a htm file. i want to activate it automaticly as the asp file is loaded no click is needed.so that the background of the BODY part will...
1
2651
by: Jeppe 1971 | last post by:
Hi Does anyone know of a way to load a HTML-page and examine the document without activating the code? I am trying to create a search-function in javascript. The idea is that the function...
1
1596
by: Patrick_Montana | last post by:
I am having a problem auto-activating a macro when I change data in a field on a form that is a combo box. I have a fair understanding of Microsoft Access but am not a programmer so I am trying to...
0
1370
by: Robert Rotstein | last post by:
I want to write a SOAP extension that gets activated from both the client and the server. From whast I have read, this should be quite easy to do. Yet I can only activate it from the server. I...
0
1317
by: Robert Rotstein | last post by:
I want to write a SOAP extension that gets activated from both the client and the server. But so far, I have only been able to activate from the server. I have a service (.asmx file) which...
2
4795
by: Hrvoje Vrbanc | last post by:
Hello all! As I have only recently started to use native ASP.NET 2.0 data access controls (and found them to be very powerful), I have one question that I was unable to find the answer to: -...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.