python函数: 默认参数: retries= 这种形式 def ask_ok(prompt, retries=, complaint='Yes or no, please!'): while True: ok = raw_input(prompt) if ok in ('y', 'ye', 'yes'): return True if ok in ('n', 'no', 'nop', 'nope'): return False retries = retries - : raise IOEr…
In [5]: import os In [6]: os.__file__ Out[6]: '/usr/local/lib/python2.7/os.pyc' In [7]: import random In [8]: random.__file__ Out[8]: '/usr/local/lib/python2.7/random.pyc' In [9]: ll /usr/local/lib/python2.7/ |head total 12276 -rw-r--r-- 1 root 18619…