Ask Your Question
1

How to literally print the output of tab completion in the command line?

asked 2017-02-06 04:17:02 -0500

jipilab gravatar image

Some time ago, I realized that pressing tab after a "." in the command line opens a new window where it is possible to scroll through the possible methods to call on this object.

Is it still possible to print inside the terminal all the possibilities?

Even if I modify the preferences of the command line from "readline" to "multicolumns", it still does not show much of the possibilities and sometimes seeing all of them at once is faster than scrolling.

Is it possible to get this feature back as before somehow?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2017-02-06 10:08:49 -0500

If you want an actual Python list of the possibilities, you can do something like this:

sage: shell = get_ipython()  # the IPython 'shell', which handles completion
sage: s = 'hello'
sage: shell.complete('s.r')
('s.r',
 [u's.replace',
  u's.rfind',
  u's.rindex',
  u's.rjust',
  u's.rpartition',
  u's.rsplit',
  u's.rstrip'])
edit flag offensive delete link more
0

answered 2017-02-06 08:06:21 -0500

tmonteil gravatar image

The answer is yes, see some more details on this answer : https://ask.sagemath.org/question/358...

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-06 04:17:02 -0500

Seen: 36 times

Last updated: Feb 06