ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 17 Dec 2012 20:16:25 -0600Searching through completions.https://ask.sagemath.org/question/9639/searching-through-completions/Hello all!
Is there a way of searching through the possible completions while using sage in a terminal?
Eg. If `g` is a `Graph`, then `g.<TAB>` yields more than 200 possible completions.
Does anyone know of a way to get only those completions containing a certain string, say `path`, without leaving the terminal? Here one would expect to get the 12 (or so) methods containing the word `path`, none of which have `path` as a prefix.
Thanks :)
Sun, 16 Dec 2012 09:55:17 -0600https://ask.sagemath.org/question/9639/searching-through-completions/Answer by John Palmieri for <p>Hello all!</p>
<p>Is there a way of searching through the possible completions while using sage in a terminal?</p>
<p>Eg. If <code>g</code> is a <code>Graph</code>, then <code>g.<TAB></code> yields more than 200 possible completions.
Does anyone know of a way to get only those completions containing a certain string, say <code>path</code>, without leaving the terminal? Here one would expect to get the 12 (or so) methods containing the word <code>path</code>, none of which have <code>path</code> as a prefix.</p>
<p>Thanks :)</p>
https://ask.sagemath.org/question/9639/searching-through-completions/?answer=14379#post-id-14379How about this:
sage: g = graphs.HigmanSimsGraph()
sage: g.*path*?
g.add_path
g.all_paths
g.disjoint_routed_paths
g.edge_disjoint_paths
g.interior_paths
g.longest_path
g.shortest_path
g.shortest_path_all_pairs
g.shortest_path_length
g.shortest_path_lengths
g.shortest_paths
g.vertex_disjoint_paths
sage: g.*path?
g.add_path
g.longest_path
g.shortest_pathSun, 16 Dec 2012 14:02:48 -0600https://ask.sagemath.org/question/9639/searching-through-completions/?answer=14379#post-id-14379Comment by John Palmieri for <p>How about this:</p>
<pre><code>sage: g = graphs.HigmanSimsGraph()
sage: g.*path*?
g.add_path
g.all_paths
g.disjoint_routed_paths
g.edge_disjoint_paths
g.interior_paths
g.longest_path
g.shortest_path
g.shortest_path_all_pairs
g.shortest_path_length
g.shortest_path_lengths
g.shortest_paths
g.vertex_disjoint_paths
sage: g.*path?
g.add_path
g.longest_path
g.shortest_path
</code></pre>
https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18507#post-id-18507I think it's an IPython feature.Mon, 17 Dec 2012 20:16:25 -0600https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18507#post-id-18507Comment by ppurka for <p>How about this:</p>
<pre><code>sage: g = graphs.HigmanSimsGraph()
sage: g.*path*?
g.add_path
g.all_paths
g.disjoint_routed_paths
g.edge_disjoint_paths
g.interior_paths
g.longest_path
g.shortest_path
g.shortest_path_all_pairs
g.shortest_path_length
g.shortest_path_lengths
g.shortest_paths
g.vertex_disjoint_paths
sage: g.*path?
g.add_path
g.longest_path
g.shortest_path
</code></pre>
https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18508#post-id-18508Is this a Sage feature or readline feature?Mon, 17 Dec 2012 17:18:40 -0600https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18508#post-id-18508Comment by Bétréma for <p>How about this:</p>
<pre><code>sage: g = graphs.HigmanSimsGraph()
sage: g.*path*?
g.add_path
g.all_paths
g.disjoint_routed_paths
g.edge_disjoint_paths
g.interior_paths
g.longest_path
g.shortest_path
g.shortest_path_all_pairs
g.shortest_path_length
g.shortest_path_lengths
g.shortest_paths
g.vertex_disjoint_paths
sage: g.*path?
g.add_path
g.longest_path
g.shortest_path
</code></pre>
https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18515#post-id-18515I would never have imagined that it could work ! Thanks John, and thanks Sage !Mon, 17 Dec 2012 01:43:20 -0600https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18515#post-id-18515Comment by fidbc for <p>How about this:</p>
<pre><code>sage: g = graphs.HigmanSimsGraph()
sage: g.*path*?
g.add_path
g.all_paths
g.disjoint_routed_paths
g.edge_disjoint_paths
g.interior_paths
g.longest_path
g.shortest_path
g.shortest_path_all_pairs
g.shortest_path_length
g.shortest_path_lengths
g.shortest_paths
g.vertex_disjoint_paths
sage: g.*path?
g.add_path
g.longest_path
g.shortest_path
</code></pre>
https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18516#post-id-18516Thanks John!Sun, 16 Dec 2012 14:57:46 -0600https://ask.sagemath.org/question/9639/searching-through-completions/?comment=18516#post-id-18516