.. _examplecompletionrst: ======================================= Example of auto completion with IPython ======================================= .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`PDF `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/example_completion.ipynb|*` Dirty trick to extend the automated completion in a notebook. .. code:: ipython3 from pyquickhelper.ipythonhelper import AutoCompletionFile from jyquickhelper.helper_in_notebook import set_notebook_name_theNotebook .. code:: ipython3 set_notebook_name_theNotebook() .. parsed-literal:: .. parsed-literal:: .. code:: ipython3 theNotebook .. parsed-literal:: 'example_completion.ipynb' .. code:: ipython3 import os path = os.path.join(os.path.abspath(os.path.dirname(theNotebook)), "..") .. code:: ipython3 d = AutoCompletionFile(path) d._members .. parsed-literal:: ['environment_yml', 'examples', 'notebooks', 'sphinxdoc'] .. code:: ipython3 d.sphinxdoc.source.index_rst._ [25:] .. parsed-literal:: 'tHub\\pyquickhelper\\_doc\\sphinxdoc\\source\\index.rst' .. code:: ipython3 import os os.listdir(d.sphinxdoc.source._) .. parsed-literal:: ['all_indexes.rst', 'all_notebooks.rst', 'all_report.rst', 'api', 'automation.jpg', 'blog', 'completed_todoextlist.rst', 'conf.py', 'contribute.rst', 'coverage', 'documentation_example.rst', 'filechanges.rst', 'gallery', 'glossary.rst', 'HISTORY.rst', 'images', 'index.rst', 'ipython_notebook_args.rst', 'issues_todoextlist.rst', 'i_cmd.rst', 'i_ex.rst', 'i_faq.rst', 'i_galleries.rst', 'i_indexes.rst', 'i_nb.rst', 'license.rst', 'notebooks_snippets', 'phdoc_static', 'phdoc_templates', 'tutorial', '_temp_custom_run_script_.py', '_temp_custom_run_script_.py.pkl', '__pycache__']