03. Finding help and keyboard shortcuts

Like any other command line utilities, Python contains methods for help. To get started with the help utility, type the help() command.

>>> help()
Welcome to Python 3.4's help utility! If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://docs.python.org/3.4/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, symbols, or topics, type "modules", "keywords", "symbols", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose name or summary contain a given string such as "spam", type "modules spam".

Within this interactive module, you can type commands such as print to open up a view that explains that function.

Let's type in quit or q to close this interactive module and instead work directly from the Python command line.

Help on a certain function call

To get help on a specific function or method directly, use the help() function, with a command inside the parentheses.

>>> help(print)

This will open up a help page that can be navigated by less controls, as outlined below:

Page down
Page up
Summary of more controller commands

Keyboard Shortcuts

Before we get started tinkering with Python, it's important to know how to quickly and efficiently navigate the keyboard. Let's learn some of the most important keyboard navigation shortcuts.

1) Beginning and Ends of lines

Use the Ctrl+A to move to the beginning of the line, and Ctrl+E to move to the end.

2) Moving among characters

Use Ctrl+B or the left arrow to move left one character, or Ctrl+F or the right arrow to move right.

3) Deleting characters

Ctrl+D will delete the next character, while Ctrl+K deletes the rest of the line after the cursor.

You may also use Ctrl+Y to "Yank" the last deleted text. This is essential cutting.

4) Undoing

To undo, use Ctrl+_.

5) History

To go back and forth in history, use Ctrl+r and Ctrl+s respectively.

Try these commands out on your computer and practice them to save time in the future.

Aching back from coding all day?

Acupressure Mat & Pillow

Aching back from coding all day? Try Back Problems

Relieve your stress, back, neck and sciatic pain through 1,782 acupuncture points for immediate neck pain relief. Made for lower, upper and mid chronic back pain treatment, and improves circulation, sleep, digestion and quality of life.

$$ Check price
144.87144.87Amazon 4.5 logo(1,890+ reviews)

More Back Problems resources

Learn to be a Pythonista!

Python Programming

Learn to be a Pythonista! Try Python

This book is designed to be used as the primary textbook in a college-level first course in computing. It takes a fairly traditional approach, emphasizing problem solving, design, and programming as the core skills of computer science. However, these ideas are illustrated using a non-traditional language, namely Python.

$ Check price
45.9945.99Amazon 4.5 logo(211+ reviews)

More Python resources