26.5. IDLE¶
+IDLE¶
Source code: Lib/idlelib/
IDLE is Python’s Integrated Development and Learning Environment.
@@ -107,7 +120,7 @@Navigation
26.5.1. Menus¶
+Menus¶
IDLE has two main window types, the Shell window and the Editor window. It is possible to have multiple editor windows simultaneously. Output windows, such as used for Edit / Find in Files, are a subtype of edit window. They currently @@ -116,7 +129,7 @@
26.5.1. Menus
-26.5.1.1. File menu (Shell and Editor)¶
+File menu (Shell and Editor)¶
- New File
- Create a new file editing window.
@@ -154,7 +167,7 @@ 26.5.1.1. File menu (Shell and Editor)
-26.5.1.2. Edit menu (Shell and Editor)¶
+Edit menu (Shell and Editor)¶
- Undo
- Undo the last change to the current window. A maximum of 1000 changes may
@@ -198,7 +211,7 @@
26.5.1.2. Edit menu (Shell and Editor)
-26.5.1.3. Format menu (Editor window only)¶
+Format menu (Editor window only)¶
- Indent Region
- Shift selected lines right by the indent width (default 4 spaces).
@@ -229,7 +242,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.4. Run menu (Editor window only)¶
+Run menu (Editor window only)¶
- Python Shell
- Open or wake up the Python Shell window.
@@ -250,7 +263,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.5. Shell menu (Shell window only)¶
+Shell menu (Shell window only)¶
- View Last Restart
- Scroll the shell window to the last Shell restart.
@@ -261,7 +274,7 @@ 26.5.1.5. Shell menu (Shell window only)
-26.5.1.6. Debug menu (Shell window only)¶
+Debug menu (Shell window only)¶
- Go to File/Line
- Look on the current line. with the cursor, and the line above for a filename
@@ -283,7 +296,7 @@
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.1. File menu (Shell and Editor)
-26.5.1.2. Edit menu (Shell and Editor)¶
+Edit menu (Shell and Editor)¶
- Undo
- Undo the last change to the current window. A maximum of 1000 changes may
@@ -198,7 +211,7 @@
26.5.1.2. Edit menu (Shell and Editor)
-26.5.1.3. Format menu (Editor window only)¶
+Format menu (Editor window only)¶
- Indent Region
- Shift selected lines right by the indent width (default 4 spaces).
@@ -229,7 +242,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.4. Run menu (Editor window only)¶
+Run menu (Editor window only)¶
- Python Shell
- Open or wake up the Python Shell window.
@@ -250,7 +263,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.5. Shell menu (Shell window only)¶
+Shell menu (Shell window only)¶
- View Last Restart
- Scroll the shell window to the last Shell restart.
@@ -261,7 +274,7 @@ 26.5.1.5. Shell menu (Shell window only)
-26.5.1.6. Debug menu (Shell window only)¶
+Debug menu (Shell window only)¶
- Go to File/Line
- Look on the current line. with the cursor, and the line above for a filename
@@ -283,7 +296,7 @@
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.2. Edit menu (Shell and Editor)
-26.5.1.3. Format menu (Editor window only)¶
+Format menu (Editor window only)¶
- Indent Region
- Shift selected lines right by the indent width (default 4 spaces).
@@ -229,7 +242,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.4. Run menu (Editor window only)¶
+Run menu (Editor window only)¶
- Python Shell
- Open or wake up the Python Shell window.
@@ -250,7 +263,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.5. Shell menu (Shell window only)¶
+Shell menu (Shell window only)¶
- View Last Restart
- Scroll the shell window to the last Shell restart.
@@ -261,7 +274,7 @@ 26.5.1.5. Shell menu (Shell window only)
-26.5.1.6. Debug menu (Shell window only)¶
+Debug menu (Shell window only)¶
- Go to File/Line
- Look on the current line. with the cursor, and the line above for a filename
@@ -283,7 +296,7 @@
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.3. Format menu (Editor window only)
-26.5.1.4. Run menu (Editor window only)¶
+Run menu (Editor window only)¶
- Python Shell
- Open or wake up the Python Shell window.
@@ -250,7 +263,7 @@ 26.5.1.3. Format menu (Editor window only)
-26.5.1.5. Shell menu (Shell window only)¶
+Shell menu (Shell window only)¶
- View Last Restart
- Scroll the shell window to the last Shell restart.
@@ -261,7 +274,7 @@ 26.5.1.5. Shell menu (Shell window only)
-26.5.1.6. Debug menu (Shell window only)¶
+Debug menu (Shell window only)¶
- Go to File/Line
- Look on the current line. with the cursor, and the line above for a filename
@@ -283,7 +296,7 @@
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.3. Format menu (Editor window only)
-26.5.1.5. Shell menu (Shell window only)¶
+Shell menu (Shell window only)¶
- View Last Restart
- Scroll the shell window to the last Shell restart.
@@ -261,7 +274,7 @@ 26.5.1.5. Shell menu (Shell window only)
-26.5.1.6. Debug menu (Shell window only)¶
+Debug menu (Shell window only)¶
- Go to File/Line
- Look on the current line. with the cursor, and the line above for a filename
@@ -283,7 +296,7 @@
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.5. Shell menu (Shell window only)
-26.5.1.6. Debug menu (Shell window only)¶
+Debug menu (Shell window only)¶
- Go to File/Line
- Look on the current line. with the cursor, and the line above for a filename
@@ -283,7 +296,7 @@
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.6. Debug menu (Shell window only)
-26.5.1.7. Options menu (Shell and Editor)¶
+Options menu (Shell and Editor)¶
- Configure IDLE
Open a configuration dialog and change preferences for the following:
@@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
Open a configuration dialog and change preferences for the following: @@ -303,7 +316,7 @@
26.5.1.7. Options menu (Shell and Editor)
-26.5.1.8. Window menu (Shell and Editor)¶
+Window menu (Shell and Editor)¶
- Zoom Height
- Toggles the window between normal size and maximum height. The initial size
@@ -314,7 +327,7 @@
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.8. Window menu (Shell and Editor)
-26.5.1.9. Help menu (Shell and Editor)¶
+Help menu (Shell and Editor)¶
- About IDLE
- Display version, copyright, license, credits, and more.
@@ -325,13 +338,13 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.9. Help menu (Shell and Editor)
-26.5.1.10. Context Menus¶
+Context Menus¶
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
@@ -359,7 +372,7 @@ 26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.1.9. Help menu (Shell and Editor)
-26.5.2. Editing and navigation¶
+Editing and navigation¶
In this section, ‘C’ refers to the Control key on Windows and Unix and
the Command key on Mac OSX.
@@ -396,7 +409,7 @@ 26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.2. Editing and navigationC-c to copy and C-v to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
-26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, Backspace deletes up
@@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.2.1. Automatic indentation¶
+Automatic indentation¶
After a block-opening statement, the next line is indented by 4 spaces (in the Python Shell window by one tab). After certain keywords (break, return etc.) the next line is dedented. In leading indentation, Backspace deletes up @@ -406,7 +419,7 @@
26.5.2.1. Automatic indentation
-26.5.2.2. Completions¶
+Completions¶
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
@@ -441,7 +454,7 @@ 26.5.2.2. Completions
-26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
@@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.2.3. Calltips¶
+Calltips¶
A calltip is shown when one types ( after the name of an accessible function. A name expression may include dots and subscripts. A calltip remains until it is clicked, the cursor is moved out of the argument area, @@ -464,7 +477,7 @@
26.5.2.3. Calltips
-26.5.2.4. Python Shell window¶
+Python Shell window¶
C-c interrupts executing command
@@ -482,7 +495,7 @@ 26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
C-c interrupts executing command
26.5.2.4. Python Shell window
-26.5.2.5. Text colors¶
+Text colors¶
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
@@ -496,7 +509,7 @@
26.5.2.5. Text colors
-26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.3. Startup and code execution¶
+Startup and code execution¶
Upon startup with the -s
option, IDLE will execute the file referenced by
the environment variables IDLESTARTUP
or PYTHONSTARTUP
.
IDLE first checks for IDLESTARTUP
; if IDLESTARTUP
is present the file
@@ -510,7 +523,7 @@
26.5.3. Startup and code execution
-26.5.3.1. Command line usage¶
+Command line usage¶
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
-26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user
code execution process. A connection must be established whenever the Shell
starts or restarts. (The latter is indicated by a divider line that says
@@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
-26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is
intended to be the same as executing the same code in a console window.
However, the different interface and operation occasionally affect
@@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
@@ -535,7 +548,7 @@ 26.5.3.1. Command line usage
26.5.3.2. Startup failure¶
+Startup failure¶
IDLE uses a socket to communicate between the IDLE GUI process and the user code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says @@ -571,7 +584,7 @@
26.5.3.2. Startup failurepython -m idlelib) and see if a message appears.
26.5.3.3. IDLE-console differences¶
+IDLE-console differences¶
With rare exceptions, the result of executing Python code with IDLE is intended to be the same as executing the same code in a console window. However, the different interface and operation occasionally affect @@ -589,7 +602,7 @@
26.5.3.3. IDLE-console differences
-26.5.3.4. Developing tkinter applications¶
+Developing tkinter applications¶
IDLE is intentionally different from standard Python in order to
facilitate development of tkinter programs. Enter import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@
26.5.3.4. Developing tkinter applications
-26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
@@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
import tkinter as tk;
root = tk.Tk()
in standard Python and nothing appears. Enter the same
@@ -609,7 +622,7 @@ 26.5.3.5. Running without a subprocess¶
+Running without a subprocess¶
By default, IDLE executes user code in a separate subprocess via a socket, which uses the internal loopback interface. This connection is not externally visible and no data is sent to or received from the Internet. @@ -635,9 +648,9 @@
26.5.3.5. Running without a subprocess
-26.5.4. Help and preferences¶
+Help and preferences¶
-26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
@@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
-26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be
changed with the Extensions tab of the preferences dialog. See the
beginning of config-extensions.def in the idlelib directory for further
@@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
26.5.4.1. Additional help sources¶
+Additional help sources¶
IDLE includes a help menu entry called “Python Docs” that will open the extensive sources of help, including tutorials, available at docs.python.org. Selected URLs can be added or removed from the help menu at any time using the @@ -645,14 +658,14 @@
26.5.4.1. Additional help sources
-26.5.4.2. Setting preferences¶
+Setting preferences¶
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
26.5.4.3. Extensions¶
+Extensions¶
IDLE contains an extension facility. Preferences for extensions can be changed with the Extensions tab of the preferences dialog. See the beginning of config-extensions.def in the idlelib directory for further @@ -668,42 +681,42 @@
26.5.4.3. Extensions
- Table Of Contents
+ Table of Contents
-- 26.5. IDLE
-- 26.5.1. Menus
-- 26.5.1.1. File menu (Shell and Editor)
-- 26.5.1.2. Edit menu (Shell and Editor)
-- 26.5.1.3. Format menu (Editor window only)
-- 26.5.1.4. Run menu (Editor window only)
-- 26.5.1.5. Shell menu (Shell window only)
-- 26.5.1.6. Debug menu (Shell window only)
-- 26.5.1.7. Options menu (Shell and Editor)
-- 26.5.1.8. Window menu (Shell and Editor)
-- 26.5.1.9. Help menu (Shell and Editor)
-- 26.5.1.10. Context Menus
+- IDLE
+- Menus
-- 26.5.2. Editing and navigation
-- 26.5.2.1. Automatic indentation
-- 26.5.2.2. Completions
-- 26.5.2.3. Calltips
-- 26.5.2.4. Python Shell window
-- 26.5.2.5. Text colors
+- Editing and navigation
-- 26.5.3. Startup and code execution
-- 26.5.3.1. Command line usage
-- 26.5.3.2. Startup failure
-- 26.5.3.3. IDLE-console differences
-- 26.5.3.4. Developing tkinter applications
-- 26.5.3.5. Running without a subprocess
+- Startup and code execution
-- 26.5.4. Help and preferences
-- 26.5.4.1. Additional help sources
-- 26.5.4.2. Setting preferences
-- 26.5.4.3. Extensions
+- Help and preferences
@@ -712,10 +725,10 @@ Table Of Contents
Previous topic
26.4. tkinter.scrolledtext
— Scrolled Text Widget
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widget
Next topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface Packages
This Page
@@ -741,10 +754,10 @@ Navigation
modules |
-
- next |
-
- previous |
Navigation
- The Python Standard Library »
- - 26. Graphical User Interfaces with Tk »
+ - Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018.
+ Last updated on Oct 27, 2018.
Found a bug?
- Created using Sphinx 1.7.4.
+ Created using Sphinx 1.8.1.
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index 21b5ea5a816e3f..ae991ee8baec28 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -126,7 +126,10 @@ def handle_endtag(self, tag):
if tag in ['h1', 'h2', 'h3']:
self.indent(0) # clear tag, reset indent
if self.show:
- self.toc.append((self.header, self.text.index('insert')))
+ indent = (' ' if tag == 'h3' else
+ ' ' if tag == 'h2' else
+ '')
+ self.toc.append((indent+self.header, self.text.index('insert')))
elif tag in ['span', 'em']:
self.chartags = ''
elif tag == 'a':
@@ -142,11 +145,15 @@ def handle_data(self, data):
if self.show and not self.hdrlink:
d = data if self.pre else data.replace('\n', ' ')
if self.tags == 'h1':
- self.hprefix = d[0:d.index(' ')]
- if self.tags in ['h1', 'h2', 'h3'] and self.hprefix != '':
- if d[0:len(self.hprefix)] == self.hprefix:
- d = d[len(self.hprefix):].strip()
- self.header += d
+ try:
+ self.hprefix = d[0:d.index(' ')]
+ except ValueError:
+ self.hprefix = ''
+ if self.tags in ['h1', 'h2', 'h3']:
+ if (self.hprefix != '' and
+ d[0:len(self.hprefix)] == self.hprefix):
+ d = d[len(self.hprefix):]
+ self.header += d.strip()
self.text.insert('end', d, (self.tags, self.chartags))
diff --git a/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
new file mode 100644
index 00000000000000..0fd26699a96c79
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-10-28-00-08-42.bpo-35087.G7gx2-.rst
@@ -0,0 +1,2 @@
+Update idlelib help files for the current doc build. The main change is the
+elimination of chapter-section numbers.
Table Of Contents
+Table of Contents
-
-
- 26.5. IDLE
-
-
- 26.5.1. Menus
-
-
- 26.5.1.1. File menu (Shell and Editor) -
- 26.5.1.2. Edit menu (Shell and Editor) -
- 26.5.1.3. Format menu (Editor window only) -
- 26.5.1.4. Run menu (Editor window only) -
- 26.5.1.5. Shell menu (Shell window only) -
- 26.5.1.6. Debug menu (Shell window only) -
- 26.5.1.7. Options menu (Shell and Editor) -
- 26.5.1.8. Window menu (Shell and Editor) -
- 26.5.1.9. Help menu (Shell and Editor) -
- 26.5.1.10. Context Menus +
- IDLE
-
+
- Menus -
- 26.5.2. Editing and navigation
-
-
- 26.5.2.1. Automatic indentation -
- 26.5.2.2. Completions -
- 26.5.2.3. Calltips -
- 26.5.2.4. Python Shell window -
- 26.5.2.5. Text colors +
- Editing and navigation -
- 26.5.3. Startup and code execution
-
-
- 26.5.3.1. Command line usage -
- 26.5.3.2. Startup failure -
- 26.5.3.3. IDLE-console differences -
- 26.5.3.4. Developing tkinter applications -
- 26.5.3.5. Running without a subprocess +
- Startup and code execution -
- 26.5.4. Help and preferences
-
-
- 26.5.4.1. Additional help sources -
- 26.5.4.2. Setting preferences -
- 26.5.4.3. Extensions +
- Help and preferences
Table Of Contents
Previous topic
26.4.
+ title="previous chapter">tkinter.scrolledtext
— Scrolled Text Widgettkinter.scrolledtext
— Scrolled Text WidgetNext topic
26.6. Other Graphical User Interface Packages
+ title="next chapter">Other Graphical User Interface PackagesThis Page
-
@@ -741,10 +754,10 @@
- - next |
- - previous |
Navigation
- The Python Standard Library » -
- 26. Graphical User Interfaces with Tk » +
- Graphical User Interfaces with Tk »
-
@@ -784,11 +797,11 @@
Navigation
- Last updated on Jun 10, 2018. + Last updated on Oct 27, 2018. Found a bug?
- Created using Sphinx 1.7.4. + Created using Sphinx 1.8.1.
Navigation
modules |
- 26.5.1. Menus