Lines Matching full:path
1 """Add Python to the search path on Windows
3 This is a simple script to add Python to the Windows search path. It
17 PATH = "PATH"
18 DEFAULT = "%PATH%"
21 pythonpath = os.path.dirname(os.path.normpath(sys.executable))
22 scripts = os.path.join(pythonpath, "Scripts")
26 userpath = os.path.dirname(usersite)
27 userscripts = os.path.join(userpath, "Scripts")
33 envpath = winreg.QueryValueEx(key, PATH)[0]
38 for path in (pythonpath, scripts, userscripts):
39 if path and path not in envpath and os.path.isdir(path):
40 paths.append(path)
43 winreg.SetValueEx(key, PATH, 0, winreg.REG_EXPAND_SZ, envpath)
49 print("Path(s) added:")
52 print("No path was added")