Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

socket python how to check if server alive

import socket
s = socket.socket(
    socket.AF_INET, socket.SOCK_STREAM)
try:
    s.connect(("localhost", 10000))
except socket.error as e:
    print e
OUTPUT
[Errno 111] Connection refused
Comment

PREVIOUS NEXT
Code Example
Python :: pytest using tempfile 
Python :: cv2 leave only the biggest blob 
Python :: ternary operator using dictionary in Python 
Python :: pytorch pad to square 
Python :: Walrus operator in list comprehensions [Python 3.8.0] 
Python :: cosine similiarity OF A VECTOR WITH OTHER VECTORS IN A MATRIX 
Python :: datetime german format python 
Python :: tweepy stream extended mode 
Python :: como escribir letras griegas en python 
Python :: sns add spine 
Python :: como usar o Self no python 
Python :: matplotlib annotate align center 
Python :: how to add a list to a list python 
Python :: dictionary comprehension 
Python :: pyplot save image 
Python :: combine two dataframes of same length 
Python :: numpy shuffle along axis 
Python :: create a pandas dataframe 
Python :: scikit decision tree regressor 
Python :: range parameters python 
Python :: python oops 
Python :: python how to put int into list 
Python :: stdin and stdout in python 
Python :: python ValueError: zero-size array to reduction operation maximum which has no identity 
Python :: false python 
Python :: DtypeWarning: Columns (7) have mixed types. Specify dtype option on import or set low_memory=False 
Python :: takes 2 positional arguments but 3 were given 
Python :: self python 
Python :: miles to km in python 
Python :: program in python to print first 10 natural number. 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =