Ask Your Question
0

Searching through completions.

asked 2012-12-16 09:55:17 -0500

fidbc gravatar image

updated 2017-01-08 05:14:10 -0500

FrédéricC gravatar image

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 :)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
5

answered 2012-12-16 14:02:48 -0500

How 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_path
edit flag offensive delete link more

Comments

Thanks John!

fidbc gravatar imagefidbc ( 2012-12-16 14:57:46 -0500 )edit

I would never have imagined that it could work ! Thanks John, and thanks Sage !

Bétréma gravatar imageBétréma ( 2012-12-17 01:43:20 -0500 )edit

Is this a Sage feature or readline feature?

ppurka gravatar imageppurka ( 2012-12-17 17:18:40 -0500 )edit

I think it's an IPython feature.

John Palmieri gravatar imageJohn Palmieri ( 2012-12-17 20:16:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-12-16 09:55:17 -0500

Seen: 114 times

Last updated: Dec 16 '12