(Nov-27-2019, 10:59 AM)buran Wrote: As the error message show, your code from first post is different from the actual code you run
as you can see, you have second argument -
Error:print("And IP address is %s : " %socket.gethostbyname(i,0))0
that cause an error. The error message is clear
Sorry dear because I am newbie in Python programming. The new error is showing below:
Error:Traceback (most recent call last):
File "C:/host-ip.py", line 20, in <module>
get_Host_name_IP()
File "C:/host-ip.py", line 16, in get_Host_name_IP
print("And IP address is %s : " %socket.gethostbyname(i,0))
TypeError: gethostbyname() takes exactly 1 argument (2 given)