Ask Your Question
0

Searching through completions.

asked 12 years ago

fidbc gravatar image

updated 8 years ago

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
5

answered 12 years ago

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
Preview: (hide)
link

Comments

Thanks John!

fidbc gravatar imagefidbc ( 12 years ago )

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

Bétréma gravatar imageBétréma ( 12 years ago )

Is this a Sage feature or readline feature?

ppurka gravatar imageppurka ( 12 years ago )

I think it's an IPython feature.

John Palmieri gravatar imageJohn Palmieri ( 12 years ago )

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: 12 years ago

Seen: 715 times

Last updated: Dec 16 '12