def CheckPythonPaths(verbose):
if verbose: print "Python Paths:"
# Check the core path
if verbose: print "\tCore Path:",
try:
appPath = win32api.RegQueryValue(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath")
except win32api.error, exc:
print "** does not exist - ", exc.strerror
problem = CheckPathString(appPath)
if problem:
print problem
else:
if verbose: print appPath
key = win32api.RegOpenKey(regutil.GetRootKey(), regutil.BuildDefaultPythonKey() + "\\PythonPath", 0, win32con.KEY_READ)
try:
keyNo = 0
while 1:
try:
appName = win32api.RegEnumKey(key, keyNo)
appPath = win32api.RegQueryValue(key, appName)
if verbose: print "\t"+appName+":",
if appPath:
problem = CheckPathString(appPath)
if problem:
print problem
else:
if verbose: print appPath
else:
if verbose: print "(empty)"
keyNo = keyNo + 1
except win32api.error:
break
finally:
win32api.RegCloseKey(key)
评论列表
文章目录