summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/tutorial%2Finteractive.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/python~3.12/tutorial%2Finteractive.html')
-rw-r--r--devdocs/python~3.12/tutorial%2Finteractive.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/devdocs/python~3.12/tutorial%2Finteractive.html b/devdocs/python~3.12/tutorial%2Finteractive.html
new file mode 100644
index 00000000..a68d65e7
--- /dev/null
+++ b/devdocs/python~3.12/tutorial%2Finteractive.html
@@ -0,0 +1,8 @@
+ <span id="tut-interacting"></span><h1> Interactive Input Editing and History Substitution</h1> <p>Some versions of the Python interpreter support editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. This is implemented using the <a class="reference external" href="https://tiswww.case.edu/php/chet/readline/rltop.html">GNU Readline</a> library, which supports various styles of editing. This library has its own documentation which we won’t duplicate here.</p> <section id="tab-completion-and-history-editing"> <span id="tut-keybindings"></span><h2>
+<span class="section-number">14.1. </span>Tab Completion and History Editing</h2> <p>Completion of variable and module names is <a class="reference internal" href="../library/site#rlcompleter-config"><span class="std std-ref">automatically enabled</span></a> at interpreter startup so that the <kbd class="kbd docutils literal notranslate">Tab</kbd> key invokes the completion function; it looks at Python statement names, the current local variables, and the available module names. For dotted expressions such as <code>string.a</code>, it will evaluate the expression up to the final <code>'.'</code> and then suggest completions from the attributes of the resulting object. Note that this may execute application-defined code if an object with a <a class="reference internal" href="../reference/datamodel#object.__getattr__" title="object.__getattr__"><code>__getattr__()</code></a> method is part of the expression. The default configuration also saves your history into a file named <code>.python_history</code> in your user directory. The history will be available again during the next interactive interpreter session.</p> </section> <section id="alternatives-to-the-interactive-interpreter"> <span id="tut-commentary"></span><h2>
+<span class="section-number">14.2. </span>Alternatives to the Interactive Interpreter</h2> <p>This facility is an enormous step forward compared to earlier versions of the interpreter; however, some wishes are left: It would be nice if the proper indentation were suggested on continuation lines (the parser knows if an indent token is required next). The completion mechanism might use the interpreter’s symbol table. A command to check (or even suggest) matching parentheses, quotes, etc., would also be useful.</p> <p>One alternative enhanced interactive interpreter that has been around for quite some time is <a class="reference external" href="https://ipython.org/">IPython</a>, which features tab completion, object exploration and advanced history management. It can also be thoroughly customized and embedded into other applications. Another similar enhanced interactive environment is <a class="reference external" href="https://bpython-interpreter.org/">bpython</a>.</p> </section> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
+ <a href="https://docs.python.org/3.12/tutorial/interactive.html" class="_attribution-link">https://docs.python.org/3.12/tutorial/interactive.html</a>
+ </p>
+</div>