physicsnoob1000
physicsnoob1000

Reputation: 1853

Python Shell shortcuts

I've just started learning python from scratch

I've installed 3.6 for windows

On the IDLE shell how can I get the shortcut for retyping what you previously executed (this is usually the up button)?

and also there is usually a drop down list for when you're typing something and python shows a list of what you might be about to type and you can select and it types it for you?

example:

thanks

Upvotes: 0

Views: 5895

Answers (4)

ruohola
ruohola

Reputation: 24058

All of the keybindings can be changed in Options > Configure IDLE > Keys. The ones in my answer are the default on Windows.

  • Cycle commands backwards: Alt+p
  • Cycle commands forwards: Alt+n
    • Alternatively, put cursor on a line you want to re-run and press Enter

  • Pop-up auto completion: Tab (or Ctrl+Space)
    • Alternatively, just set Options > Configure IDLE > General > Completions Popup Wait to 0, for the autocompletion to always come up automatically

Upvotes: 0

Firebolt
Firebolt

Reputation: 97

For Python 3.6 on Windows, specifically.

  • Shortcut to get what you typed previously: Alt + P

  • To get auto completion: Ctrl + space

Also, you can navigate the configuration for these Shortcut Keys in the Navigation bar.

Upvotes: 1

Igor Yudin
Igor Yudin

Reputation: 403

Press enter on the line you want to retype

EDIT

To show autocomplete window press TAB.

There's a default delay in 2 seconds. You can set popupwait to 0 in Options->Configure IDLE->Extensions->AutoComplete. Take into accout that you should restart you shell to activate new settings.

Upvotes: 1

alonkol
alonkol

Reputation: 390

To get last command executed, use alt+p.

Otherwise, under the Options menu, go to Configure IDLE >> Keys, and set history-next/history-previous to the keys you wish to use.

Upvotes: 2

Related Questions