File start:
#!/usr/bin/env python#-*-coding:utf-8-*-#上面一行适用于3以前的版本
When line comment: # comment
Multiline Comment: "" "" "" "" "or" "" comment "
Enter Password:
Import getpasspwd = Getpass.getpass ("Please enter password:")
Module Find path:
Import Sysprint (Sys.path) #[", ' D:\\Program files\\python35\\python35.zip ', ... #空格代表与执行文件同一目录, not current path # But in Python's command-line mode, it represents the current path
Command-line arguments:
Import Sysprint (SYS.ARGV)
Python command-line mode auto-complete function (Linux):
#!/usr/bin/env Python # python startup file import sysimport readlineimport rlcompleterimport atexitimport os# tab complet Ion Readline.parse_and_bind (' Tab:complete ') # history file Histfile = Os.path.join (os.environ[' HOME '), '. pythonhistory ') Try:readline.read_history_file (histfile) except IOError:passatexit.register (Readline.write_history_file, Histfile) del os, Histfile, ReadLine, Rlcompleter
This article is from the "Opopopop" blog, make sure to keep this source http://luotaoyang.blog.51cto.com/545649/1868221
Python Knowledge Point Memo