Created
April 19, 2018 20:23
-
-
Save theboshy/db345ebbcf22612f940300e5648d226b to your computer and use it in GitHub Desktop.
Permite verificar si un puerto se encuentra disponible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
result = sock.connect_ex(('127.0.0.1',3000)) | |
if result == 0: | |
print "Port is open" | |
else: | |
print "Port is not open" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment