PRO_gramer

farol

Sep 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import socket
  2. import platform
  3.  
  4. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  5. host = socket.gethostname()
  6. porta = 9999
  7.  
  8. lis =[]
  9. lis.append('tipo de arquitetura: '+ platform.machine())
  10. lis.append('nome da máquina '+ platform.node())
  11. lis.append('versao do python '+ platform.python_version())
  12.  
  13. print(lis)
  14. s.bind((host, porta))
  15. enviar = ''.join(lis)
  16. s.listen(1000)
  17. while True:
  18.     c, e = s.accept()
  19.     c.send(enviar.encode('ascii'))
  20. c.close()
Advertisement
Add Comment
Please, Sign In to add comment