function definition def test()

def test(x):
    y=2*x+1
    return y
print(test(3))
Simple calculation 
def
test(x): y =2*x+1 return y t=input('>>>') y=test(int(t)) print(y)
while True
    if cpu>90%
        connect to the server
        send email
        close the connection
    if memory>90%
        connect to the server
        send email
        close the connection
    if hard disk>90%
        connect to the server
        send email
        The use of closing the connection  

function simplifies the utilization of the code
...
def Email Alert: (content) connect to the server send email close the connection if cpu>90% Email reminder (cpu alarm) if memory>90% Email reminder (memory alarm) if hard disk>90% Email reminder (hard disk alarm)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324771127&siteId=291194637