Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Restart the interactive python shell like in IDLE

Reply
Thread Tools

Re: Restart the interactive python shell like in IDLE

 
 
Chris Rebert
Guest
Posts: n/a
 
      06-10-2009
On Wed, Jun 10, 2009 at 12:01 PM, Matt Burson<(E-Mail Removed)> wrote:
> Is there a way to reproduce the behavior of IDLE's restart shell ability by
> using a function? I thought there would be since you can exit python by
> executing the simple quit() function I thought there would be an equally
> simple function name something like restart(). I'd prefer something like
> this as opposed to having to exit the shell and then start it up again to
> refresh it.


I believe IDLE itself implements the "restart" capability by killing
and re-launching its Python interpreter subprocess, so it's not like
it's using some hidden capability of Python to accomplish this.
Is doing Ctrl+D, up-arrow, Enter really that hard? It's even fewer
keystrokes than "restart()"...

Cheers,
Chris
--
http://blog.rebertia.com
 
Reply With Quote
 
 
 
 
Ricardo Abreu
Guest
Posts: n/a
 
      09-30-2013
On Thursday, June 11, 2009 1:48:42 AM UTC+2, Chris Rebert wrote:
> On Wed, Jun 10, 2009 at 12:01 PM, Matt Burson<(E-Mail Removed)> wrote:
> > Is there a way to reproduce the behavior of IDLE's restart shell ability by
> > using a function? I thought there would be since you can exit python by
> > executing the simple quit() function I thought there would be an equally
> > simple function name something like restart(). I'd prefer something like
> > this as opposed to having to exit the shell and then start it up again to
> > refresh it.

>
> I believe IDLE itself implements the "restart" capability by killing
> and re-launching its Python interpreter subprocess, so it's not like
> it's using some hidden capability of Python to accomplish this.
> Is doing Ctrl+D, up-arrow, Enter really that hard? It's even fewer
> keystrokes than "restart()"...
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com


You might be launching python from something else other than a shell and it might be harder to re-launch it from there
 
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
How to make statements running in strictly sequential fashion like inan interactive shell lzlu123 Python 4 08-22-2011 02:33 PM
Re: Restart the interactive python shell like in IDLE Terry Reedy Python 0 06-11-2009 07:04 PM
Start a python interactive shell from python. Bo Peng Python 2 01-26-2006 06:46 PM
IDLE history, Python IDE, and Interactive Python with Vim Ashot Python 22 02-08-2005 05:38 AM
Python Interactive Shell - outputting to stdout? Avi Berkovich Python 7 12-28-2004 01:45 AM



Advertisments