Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:52:21+00:00 2026-05-31T10:52:21+00:00

In the standard Python interactive shell, I can press Ctrl + D to close

  • 0

In the standard Python interactive shell, I can press Ctrl+D to close stdin and it shows the output:

$ python
Python 2.7.2 (default, Mar  7 2012, 21:18:58) 
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> for f in range(5):
...     print f     (I press Enter here)
...                 (I press Ctrl+D here) 
0
1
2
3
4
>>> 

But in IPython and bpython, Ctrl+D doesn’t work, I must press Enter twice to get the results:

IPython:

In [1]: for f in range(5):
   ...:     print f     (I press Enter here)
   ...:                 (I press Enter here)
   ...:                 (I press Enter here)
0
1
2
3
4

bpython:

>>> for f in range(5):
...     print f     (I press Enter here)
...                 (I press Enter here)
...                 (I press Enter here)
0
1
2
3
4

The version which I’m using:

[I] dev-python/ipython
     Available versions:  0.10 0.10.1 0.10.2 ~0.12-r1 {doc emacs examples gnuplot matplotlib mongodb notebook qt4 readline (+)smp sqlite test wxwidgets}
     Installed versions:  0.10.2(03:54:09 PM 08/12/2011)(examples readline -doc -emacs -gnuplot -smp -test -wxwidgets)
     Homepage:            http://ipython.org/
     Description:         Advanced interactive shell for Python

[I] dev-python/bpython
     Available versions:  0.9.7.1 0.10.1 {gtk urwid}
     Installed versions:  0.10.1(10:34:17 AM 03/14/2012)(gtk -urwid)
     Homepage:            http://www.bpython-interpreter.org/ https://bitbucket.org/bobf/bpython/ http://pypi.python.org/pypi/bpython
     Description:         Syntax highlighting and autocompletion for the Python interpreter
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:52:22+00:00Added an answer on May 31, 2026 at 10:52 am

    I solved half the problem by upgrading IPython to version 0.12-r1:

    [I] dev-python/ipython
         Available versions:  0.10 0.10.1 0.10.2 (~)0.12-r1 {doc emacs examples gnuplot matplotlib mongodb notebook qt4 readline (+)smp sqlite test wxwidgets}
         Installed versions:  0.12-r1(11:47:58 AM 03/16/2012)(examples qt4 readline smp -doc -emacs -matplotlib -mongodb -notebook -sqlite -test -wxwidgets)
         Homepage:            http://ipython.org/
         Description:         Advanced interactive shell for Python
    

    Pay attention to the ...: you’ll see that I only need to press Enter two times: the first one to make a new line and the second one to close stdin and display the results:

    $ ipython
    Python 2.7.2 (default, Mar  7 2012, 21:18:58) 
    Type "copyright", "credits" or "license" for more information.
    
    IPython 0.12 -- An enhanced Interactive Python.
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    
    In [1]: for i in range(2):
       ...:     for j in range(2):
       ...:         print i*j
       ...:         
    0
    0
    0
    1
    

    About bpython, it needs to go to the line which has no indentation before showing the output. For testing purposes, if I use two nested for loops, I must press Enter four times:

    >>> for i in range(2):
    ...     for j in range(2):
    ...         print i*j
    ...         
    ...     
    ... 
    0
    0
    0
    1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain algorithm for itertools.permutations routine in Python standard lib 2.6? I
In the standard Python documentation, system calls appear as bold, fixed-width font. You can
I need information about any standard python package which can be used for longest
I use standard tips for customizing interactive Python session: $ cat ~/.bashrc export PYTHONSTARTUP=~/.pystartup
I have installed eclipse installed along with enthought. I can import my standard python
I am in a situation where importing non-standard python libraries is not suitable. Is
What's ActivePython actually about? From what I've read it's just standard Python with OpenSSL
standard power operation ( ** ) in Python does not work for negative power!
If I remember correctly Python ships with Tk as it's standard framework. What's Ruby's
The hindrance we have to ship python is the large size of the standard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.