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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -