Judging server unreachable from Python script, to Zabbix alarm

1. The python script gets the IP of the unreachable server:Determine if the host can be reached with a simple ping command. The script based on the python3.3.6,python2.x version of the queue module should be queue.#!/usr/bin/python#-*- coding: utf-8 

PYTHON+OPENCV for dynamic object tracking

Original link: 50649811ImportCv2ImportNumPy as NP camera=Cv2. Videocapture (0) Firstframe=None whileTrue:ret,frame=Camera.read ()if notret: BreakGray=Cv2.cvtcolor (Frame,cv2. Color_bgr2gray) Gray=cv2. Gaussianblur (Gray, 21,21), 0)ifFirstframe

Python Learning note __7.2 using @property

# This is a learning note for the Liaoche teacher Python tutorial1. Overview@property Allows you to call "method" as "property"# method source CodeClass Student (object):def get __ score (self):Return Self.__scoredef set __ score (self, value):If

Python decorates a function----multiple adorners

#装饰器回顾:# Def wrapper (f): #f = func1# def inner (*args,**kwargs):# Print (333) #1. 333# ret=f (*args,**kwargs)# Print (666)# return RET# return Inner# @wrapper # func1=wrapper (func1) =inner# def func1 (): # inner () defines a function that loads

The the-the-the-Python Day 2

  Today,i got lots of knowledge of Python, like how to get the maximum value of three numbers.Similarly I already was able to write a program of how to get the minium number among many numbers.Here are the Minium value program:Num_one=input ("Enter

Python's process of writing ' User login program '

Job Requirements:Basic requirements: Let the user enter the user name password Authentication successful display welcome information after the error three to exit the program upgrade requirements: can support multiple users login (prompt, through

Python Learning note __12.5 hashlib

# This is a learning note for the Liaoche teacher Python tutorial1 , overviewPython's hashlib provides a common digest algorithm, such as md5,sha1 and so on.Abstract the algorithm is also called hash algorithm and hashing algorithm. It uses a

Basic knowledge of Python

Brief introductionPython is an object-oriented, interpreted computer programming language that was invented by Dutch Guido van Rossum in 1989 and the first public release was released in 1991.Python language Features1.Python is an interpretive

Python Learning Network programming.py

Socket# with a Socke t means "open a network Connection" # Open a Socket you need to know the IP address and port number of the destination computer, and then specify the protocol type. # tcp# actively initiates the connection is the client, the

Python Learning note __12.7 itertools

# This is a learning note for the Liaoche teacher Python tutorial1. OverviewPython's built-in module Itertools provides useful functions for manipulating iterative objects.1.1. Several "infinite" iterators provided by Itertools 0) count ()>>> Import

Python Naming conventions

Canonical naming to avoid low-level problems 1. The best name is English characters, underline _, the number of three components 2. Project (Project) name, package name, module name, etc. should be in English beginning, not pure numbers ,

Python Learning note __4.2 return function

# This is a learning note for the Liaoche teacher Python tutorial1 , function as return valueHigher-order functions can also return a function as a result value, in addition to the ability to accept functions as parameters.# additive functiondef

Python Learning Notes (15) Exception handling

The Python parser executes the program, detects an error, triggers an exception, the exception is triggered and is not processed, the program terminates at the current exception, and the subsequent code does not run, so you must provide an exception

Python sends e-mail using the Smtplib module

Pattern Example:#!/usr/bin/env python#-*-coding:utf-8-*-import smtplibimport stringhost= "smtp.gmail.com" subject= "This is a test" TO= " [Email protected] "from=" [email protected] "text=" let us try to get Python mail "Body=string.join ((" from:%s

Python's Chinese University crawler

chr

1 #!/usr/bin/env Python32 #-*-coding:utf-8-*-3 ############################4 #File Name:zuihaodaxuepaiming.py5 #Author:frank6 #Mail: [email protected]7 #Created time:2018-05-15 21:45:558 ############################9 Ten ImportRequests One

JSON serialization for Python

      info = { "Name":"Roger", "Age":12}Open ("test.txt","W")F.write (str (info))F.close ()Open ("test.txt","R")data = F.read ()Print (data["name"])F.close ()Will errorUse eval ()Open ("test.txt","R")data = F.read ()Print (eval (data) ["name"])

The basic usage of the requests module in the Python module is detailed

首先还是老生长谈,说说定义和作用,request模块是一个用于访问网络的模块,其实类似的模块还有很多,不在一一在这里解释。这么多的相似的模块为什么都说只有这个好用呢。因为他人性化。如果你学过urllib之类的模块的话,对比一下就很清楚了(文章url以题目实验吧的唯快不破)。1, no matter what kind of script we all know the first to import the modules we need2, since this module is to

The redirection problem of Python crawler

Redirection IssuesThere are a number of 301,302 problems that you will inevitably encounter in the process of using Python crawlers. When they appear, it affects the speed and accuracy of our crawlers to a great extent. The following are different

Examples of Python and selenium and Chrome's primary automation operations

Examples of Python and selenium and Chrome's primary automation operations #coding =utf-8from Selenium Import webdriverimport os,timechromedriver = "C:\Users\li.liu\AppData\Local\Google\Chrome \chromedriver.exe "'" Environ is an image object for

On the parameter transfer of functions in Python

1. Normal parameter passing >>> def add (A, B): return a+b >>> print Add (3>>>) print Add (' abc ', ' 123 ') abc123 2. The number of parameters is optional, the parameter has the default value of the delivery >>> def myjoin (string,sep= ' _ ')

Total Pages: 4013 1 .... 2309 2310 2311 2312 2313 .... 4013 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.