Ask Your Question
0

Searching through completions.

asked 2012-12-16 16:55:17 +0100

fidbc gravatar image

updated 2017-01-08 12:14:10 +0100

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 21:02:48 +0100

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 21:57:46 +0100 )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 08:43:20 +0100 )edit

Is this a Sage feature or readline feature?

ppurka gravatar imageppurka ( 2012-12-18 00:18:40 +0100 )edit

I think it's an IPython feature.

John Palmieri gravatar imageJohn Palmieri ( 2012-12-18 03:16:25 +0100 )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 16:55:17 +0100

Seen: 689 times

Last updated: Dec 16 '12