9-9. py Thon document string. Go to the directory where the python standard library is located. Check each. py file to see if there is any
_ Doc _ string. If yes, sort the format properly.ProgramAfter the execution is completed,
Beautiful list. lists which modules have document strings and the content of document strings.
The name of the character string module.
# Filename: test9-9.pyimport OSHAS = [] nhas = [] def doc_string (): OS. chdir ("G: \ Python") CWD = OS. getcwd () # print CWD doclist = OS. listdir (CWD) for D in doclist: Path = OS. path. join (CWD, d) # print path if OS. path. isfile (PATH): h_doc = 0 fp = open (path, 'R') for line in FP: If '\ ''In line: Has. append (PATH) h_doc = 1 break if h_doc = 0: nhas. append (PATH) FP. close () print "Doc has _ Doc __:", has print "\ ndoc hasn' t _ Doc __:", nhas doc_string ()
All functions are not completed, such as output document string