Skip to content

Instantly share code, notes, and snippets.

@mperlet
Created March 24, 2017 15:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperlet/4ccd8a646b5d89aa77723429b595fb36 to your computer and use it in GitHub Desktop.
Save mperlet/4ccd8a646b5d89aa77723429b595fb36 to your computer and use it in GitHub Desktop.
python port check one line bash
python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',8000)) else False"
@JayGlass
Copy link

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment