| Server IP : 118.27.122.248 / Your IP : 216.73.216.109 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_� � @ s� d Z ddlZddlZddlZddlmZmZ dd� Zedkr�ej d Z
eej �dkrbeej d �nd Z
ejd
e
e�Zedje
e
�� yej� W n ek
r� ed� Y nX dS )
a
Small wsgiref based web server. Takes a path to serve from and an
optional port number (defaults to 8000), then tries to serve files.
Mime types are guessed from the file names, 404 errors are raised
if the file is not found. Used for the make serve target in Doc.
� N)�
simple_server�utilc C s� t jjt| d dd � �}d|jt jj�d kr>t jj|d�}tj|�d }t jj|�rx|dd|fg� tj t
|d��S |d d
g� dgS d S )NZ PATH_INFO� �.z
index.htmlr z200 OK�Content-Type�rbz
404 Not Found�
text/plains not found���)r r )�os�path�join�split�sep� mimetypesZ
guess_type�existsr ZFileWrapper�open)�environZrespond�fn�type� r �8/opt/alt/python36/lib64/python3.6/Tools/scripts/serve.py�app
s r �__main__r � i@ � z(Serving {} on port {}, control-C to stopzShutting down.)�__doc__�sysr
r Zwsgirefr r r �__name__�argvr �len�intZportZmake_serverZhttpd�print�formatZ
serve_forever�KeyboardInterruptr r r r �<module> s