Skip to content

Instantly share code, notes, and snippets.

@edsu
Created June 14, 2011 14:04
Show Gist options
  • Select an option

  • Save edsu/1024956 to your computer and use it in GitHub Desktop.

Select an option

Save edsu/1024956 to your computer and use it in GitHub Desktop.
check to see if i can bind to a port
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.bind(('localhost', 8080))
>>> s.listen(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment