Your IP : 216.73.216.213
3
� f � @ sl d Z ddlZddlmZmZmZ ddlZddlZdZdZdd� Z dd � Z
y
e � W n ek
rf Y nX dS )
z�
Remote python server.
Execute Python commands remotely and send output back.
WARNING: This version has a gaping security hole -- it accepts requests
from any host on the Internet!
� N)�socket�AF_INET�SOCK_STREAMi i c C s� t tj�dkrttjd �} nt} ttt�}|jd| f� |j d� xd|j
� \}\}}td||� d}x|jt
�}|sxP ||7 }qhW t|j� �}|j|j� � |j� qFW d S )N� � zconnection from� )�len�sys�argv�int�PORTr r r ZbindZlistenZaccept�printZrecv�BUFSIZE�execute�decode�send�encode�close)Zport�sZconnZ
remotehostZ
remoteport�request�dataZreply� r �8/opt/alt/python36/lib64/python3.6/Tools/demo/rpythond.py�main s$
r c C sj t j}t j}tj� t _ t _}z2yt| i i � W n t� tjd� Y nX W d |t _|t _X |j � S )N�d )
r �stdout�stderr�io�StringIO�execr
� traceback� print_exc�getvalue)r r r Zfakefiler r r r ( s r )�__doc__r r r r r r r r r r �KeyboardInterruptr r r r �<module> s