| Server IP : 118.27.122.248 / Your IP : 216.73.216.124 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/ |
Upload File : |
3
x2_z � @ sX d Z ddlZddlZddlZddlZejZdZdZdZ dd� Z
dd � Zed
krTe� dS )a Add Python to the search path on Windows
This is a simple script to add Python to the Windows search path. It
modifies the current user (HKCU) tree of the registry.
Copyright (c) 2008 by Christian Heimes <christian@cheimes.de>
Licensed to PSF under a Contributor Agreement.
� NZEnvironment�PATHz%PATH%c
C s t jjt jjtj��} t jj| d�}t jd }tt d�rbt j
j|d�}t jj|�}t jj|d�}nd }tj
tt���}ytj|t�d }W n tk
r� t}Y nX |g}x4| ||fD ]&} | r�| |kr�t jj| �r�|j| � q�W t jj|�}tj|tdtj|� ||fS Q R X d S )NZScripts�APPDATA� USER_SITEz %APPDATA%r )�os�path�dirname�normpath�sys�
executable�join�environ�hasattr�siter �replace�winregZ CreateKey�HKCU�ENVZQueryValueExr �OSError�DEFAULT�isdir�append�pathsepZ
SetValueExZ
REG_EXPAND_SZ)
Z
pythonpath�scriptsZappdataZusersiteZuserpathZuserscripts�key�envpath�pathsr � r �?/opt/alt/python36/lib64/python3.6/Tools/scripts/win_add2path.py�modify s(
r c C sd t � \} }t| �dkr6td� tdj| dd � �� ntd� td| � td� ttj|�� d S )N� zPath(s) added:�
zNo path was addedz
PATH is now:
%s
z Expanded:)r �len�printr r ZExpandEnvironmentStrings)r r r r r �main. s
r# �__main__)
�__doc__r r r r �HKEY_CURRENT_USERr r r r r r# �__name__r r r r �<module> s