Difference Between Python's IDLE and its command line
Asked Answered
N

5

5

What are the key differences between Python's IDLE and its command line environment? IDLE looks nicer, of course, and has some kind of GUI...

Moreover, is IDLE treated the same as the shell? I mean, the shell is the middle layer between the user and Python's interpreter?

Nesbitt answered 10/9, 2015 at 9:12 Comment(0)
A
5

They are both the same thing but, IDLE is made to write python code so its better if you can to write on IDLE. You can also try Notepad++ its a pretty good program to write code on.

Alberic answered 10/9, 2015 at 10:8 Comment(0)
O
5

I am not sure what you question is, but here is a Windows-7 oriented answer of similarity and difference. In the start menu for Python x.y, you can select 'Python x.y (x bits)' to run python interactive in a text-line-oriented console window provided by Microsoft. The console handles key presses and mouse movements and clicks. When you hit , the console sends the line of text to python, which is waiting for input on sys.stdin. When Python processes the line, it sends output to sys.stdout or sys.stderr. This includes '>>> ' and '... ' prompts. The console displays the text for you to see.

In the start menu, you can instead select 'Idle ...'. Unless you have previously selected a different startup option, python run Idle code which uses the tkinter module which used tcl/tk to run a graphical user interface that somewhat imitates the console. The tkinter/tk gui handles key and mouse input and displays output. In both cases, some software besides the Python interpreter itself handles interaction between you and Python.

Some important differences:

  1. Cut, copy, and paste work normally. The Windows console is crippled in this respect.

  2. Idle colors input and output. The Windows console does not.

  3. Idle can display all unicode BMP (the first 64K) chars. The Windows console is limited by code pages.

For 1, 2, and 3, the console of other OSes may do as well or better than Idle.

  1. Idle lets you enter, edit, send, and retrieve complete statements. Interactive python with Windows console only works with physical lines.

Update, 2017/11:

Item 1 above: At least on current Win10, cut, copy, and paste work normally.

Item 3 above: At least on Win10, unicode works better in Command Prompt with 3.6+.

New item 5: The IDLE doc section, also available as Help => IDLE Help now has section '3.3. IDLE-console differences'.

Obara answered 11/9, 2015 at 8:12 Comment(1)
This is a better explanation!Informal
A
1

IDLE is a very simple Integrated Development Environment. It runs the same python, libraries etc. as commant-line.

Even more basic (with less features) is IPython. Full feature IDE for Python is, for example, Eclipse with PyDev plugin, or LiClipse.

Ailment answered 10/9, 2015 at 10:14 Comment(0)
S
0

Python IDLE is where you write your program/s and Python Shell is where you run your program/s.

Sestet answered 24/1, 2016 at 11:29 Comment(0)
M
0

In my personal understanding, Python IDLE is a GUI program that includes a Python CLI shell as one of its components.

Montcalm answered 22/2 at 18:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.