# Formatiert alle Dateien der Standard-Bibliothek gemäß PEP8 import os from os import path import urllib.error import urllib.request as req fehlender_verweis = "" print(os.getcwd()) curwd = os.getcwd() for i in os.listdir("C:/Python34/Lib"): print(i) try: if i == "__phello__.foo.py": # leere Datei continue elif path.isdir(i): # Falls das Teil ein Verzeichnis ist, lass die Finger davon continue elif i.split(".py")[0] == i: # falls das Teil keine Pythonendung hat continue # , lass die Finger davon else: ## print(""" ## -------------------------------------------------------- ## ## Die folgenden Module werden wirklich verändert:""") exec("import " + i.split(".py")[0]) except ImportError: print("!!!!!!!!!!!"+i.split(".py")[0]+"!!!!!!!!!!!") continue try: f = req.urlopen("https://docs.python.org/3/library/"+i.split(".py")[0]+".html") data = f.read().decode('utf-8') if """

Source code: Lib/'''+i+"

" not in data: print("""-----https://docs.python.org/3/library/"""+i.split(".py")[0]+".html") fehlender_verweis += \ """https://docs.python.org/3/library/"""+\ i.split(".py")[0]+".html\n" except urllib.error.HTTPError: print("Achtung: https://docs.python.org/3/library/"""+i.split(".py")[0]+".html gibt es nicht") print() print(fehlender_verweis)