Write a Python program to get the name of the host on which the routine is running


Introduction

Write a Python program to get the name of the host on which the routine is running. I have used python 3.7 compiler for debugging purpose.


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. import socket
  2. host_name = socket.gethostname()
  3. print()
  4. print("Host name:", host_name)
  5. print()

Result

python language techstudy.org

     





Related Topics




Popular Posts