Python tutorials Common keys and mechanisms

Source: Internet
Author: User

Python Online Learning Tutorials:


Common keys:


Ctrl+d or Quit () to quit Python


C-a (CONTROL-A) moves the cursor to the beginning of the line, C-E to the end, C-b moves it one position to the left, c-f to the right. Backspace erases the character to the left of the cursor, and c-d the character to their right. C-k kills (erases) the rest of the line to the right of the cursor, c-y Yanks back and the last killed string. C-underscore undoes the last change to you made; C-p moves one line up on the history buffer, C-n moves one down.


IPython, which features tab completion, object exploration and advanced history management. It can also is thoroughly customized and embedded into other applications. Another similar enhanced interactive environment is Bpython.


Python would execute the contents of a file identified by the PYTHONSTARTUP environment variable when you start an interact Ive interpreter.


Mechanism:

When called with standard input connected to a TTY device, it prompts for commands and executes them until an EOF (an end- Of-file character, you can produce this with ctrl-d on UNIX or ctrl-z, Enter on Windows) is read.

When the called with a file name argument or with a file as standard input, it reads and executes a script from the that file.

When called with a directory Name argument, it reads and executes an appropriately named script from the that directory.

When called With-c command, it executes the Python statement (s) given as command. Here command is contain multiple statements separated by newlines. Leading whitespace is significant in Python statements!

When called With-m Module-name, the given module was located on the Python module path and executed as a script.


Note that the hash, or pound, character, ' # ', was used to start a comment in Python.


The last printed expression was assigned to the variable _;don ' t explicitly assign a value to It-you would create an Inde Pendent local variable with the same name masking the built-in variable with its magic behavior. The string is enclosed with double quotes if the string contains a single quote and no double quotes, otherwise it is Enclos Ed in single quotes.


can refer to and learn from the website: https://docs.python.org/2/tutorial/interpreter.html

http://python.org/

This article is from the "Cloud Light Breeze" blog, please be sure to keep this source http://htlbydgod.blog.51cto.com/9829379/1630699

Python tutorials Common keys and mechanisms

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.