Python tutorials 常用鍵以及機制

來源:互聯網
上載者:User

標籤:python tutorials 常用鍵以及機制

Python網上學習tutorials:


常用的鍵:


ctrl+D或者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, C-D the character to its right. C-K kills (erases) the rest of the line to the right of the cursor, C-Y yanks back the last killed string. C-underscore undoes the last change you made;C-P moves one line up (back) in the history buffer, C-N moves one down.


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


Python will execute the contents of a file identified by the PYTHONSTARTUP environment variable when you start an interactive interpreter.


機制:

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 that with Ctrl-D on UNIX or Ctrl-Z, Enter on Windows) is read.

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

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

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

When called with -m module-name, the given module is located on the Python module path and executed as a script.


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


The last printed expression is assigned to the variable _;Don’t explicitly assign a value to it — you would create an independent local variable with the same name masking the built-in variable with its magic behavior.The string is enclosed in double quotes if the string contains a single quote and no double quotes, otherwise it is enclosed in single quotes.


可以參考與借鑒的網站:https://docs.python.org/2/tutorial/interpreter.html

http://python.org/

本文出自 “雲淡風輕” 部落格,請務必保留此出處http://htlbydgod.blog.51cto.com/9829379/1630699

Python tutorials 常用鍵以及機制

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.