We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ip command is not installed by default in MacOS(Sonoma).
ip
Probably something like below can do the job(in my machine at least):
ifconfig en0 | grep -E 'inet\b' | cut -f 2 -d ' '
Linux also has ifconfig installed but it's deprecated now.
ifconfig
There is another cross-platform solution like:
import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) print(s.getsockname()[0]) s.close()
But it needs internet connection.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ip
command is not installed by default in MacOS(Sonoma).Probably something like below can do the job(in my machine at least):
Linux also has
ifconfig
installed but it's deprecated now.There is another cross-platform solution like:
But it needs internet connection.
The text was updated successfully, but these errors were encountered: