Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > switch to interactive mode

Reply
Thread Tools

switch to interactive mode

 
 
nntpman68
Guest
Posts: n/a
 
      03-16-2009
Hi

I know about two ways to enter python interactive mode

1.) just start python

2.) run python -i pythonscript.py

What I am looking for is slightly different:

I'd like, that a python script can be started by just calling it
(clicking on it),


but that the script can decide to enter interactive mode if certain
conditions occur.

Is this possible?



 
Reply With Quote
 
 
 
 
JBW
Guest
Posts: n/a
 
      03-16-2009
On Mon, 16 Mar 2009 23:49:34 +0100, nntpman68 wrote:

> I'd like, that a python script can be started by just calling it
> (clicking on it),
>
> but that the script can decide to enter interactive mode if certain
> conditions occur.
>
> Is this possible?


Don't know about the clicky-clicky part, but I've used code.interact to
do something similar.

JBW

 
Reply With Quote
 
 
 
 
Mike Driscoll
Guest
Posts: n/a
 
      03-16-2009
On Mar 16, 5:49*pm, nntpman68 <(E-Mail Removed)> wrote:
> Hi
>
> I know about two ways to enter python interactive mode
>
> 1.) just start python
>
> 2.) run python -i pythonscript.py
>
> What I am looking for is slightly different:
>
> I'd like, that a python script can be started by just calling it
> (clicking on it),
>
> but that the script can decide to enter interactive mode if certain
> conditions occur.
>
> Is this possible?


That sounds kind of like needing to embed the interpreter. I would
recommend looking into that. Wingware's Wing IDE has this feature
where you can run the program up a breakpoint and then use their
debugger to interact with the variables and objects and such.

Mike
 
Reply With Quote
 
nntpman68
Guest
Posts: n/a
 
      03-16-2009
Hi JBW.


code.interact() does what I wanted. Great !!!


Thanks



N

JBW wrote:
> On Mon, 16 Mar 2009 23:49:34 +0100, nntpman68 wrote:
>
>> I'd like, that a python script can be started by just calling it
>> (clicking on it),
>>
>> but that the script can decide to enter interactive mode if certain
>> conditions occur.
>>
>> Is this possible?

>
> Don't know about the clicky-clicky part, but I've used code.interact to
> do something similar.
>
> JBW
>

 
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
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
is interactive mode same as calculator mode? Alex Python 1 09-09-2005 12:54 PM
Interactive/Non-interactive ASPX ? WJ ASP .Net 2 02-26-2005 02:54 AM
non Interactive and Interactive AAH Computer Support 0 01-09-2005 04:09 PM
Interactive and non interactive AAH Computer Support 1 01-09-2005 04:01 PM



Advertisments