Using socket module in website integrated python 3 IDE -
import socket = socket.gethostbyname(socket.gethostname()) print(a)
when run code in ide in pc, shows ipv4 address of pc.
but when run code in integrated ide in sololearn, shows other ipv4 address not mine. how modify code show ip address of user , not server?
socket.gethostname()
return string containing hostname of machine python interpreter executing.
note: gethostname() doesn’t return qualified domain name; use getfqdn() that.
i've never heard of sololearn, python documentation crystal clear on one. it's possible local name resolver configured strangely, beyond scope of question.
Comments
Post a Comment