Use Paramiko Bulk Query host information script because after the bulk installation of the host, the host IP sometimes DHCP allocation will be chaotic, but due to the large number of hosts, troubleshooting more trouble, So wrote a patrol script
Smtplib & EmailOverviewE-mails are mainly used in smtplib and email modules. Stmplib is used for the connection between the mailbox and the server, sending the steps. e-mail module is mainly used to deal with encoding, message content and so on.
List parsing type:[Expr for Iter_var in iterable if COND_EXPR]Generator expression:(Expr for Iter_var in iterable if cond_expr) The difference between the two:-the list parsing needs to generate all the data;-The generator parse does not actually
Environment
Python 3.6, Window 64bit
Objective
Output 9*9 multiplication table
Code
#-*-Coding:utf-8-*-"1*1=12*1=2 2*2=49*1=9 9*2=18 .... 9*9=81 ' # Forward for I in range (1,10,1): for J in Range (1,i+1,1): print (str (i)
Tag:highlight cannot find add content rgs pre decorators effects Unified function ' # does not change the original function code, execute other code before or after calling the original function # no argument is two
Managing Linux often uses Python scripts, and then writes scripts, often worrying about the resulting files taking up disk space, which write functions to facilitate later use:Def rmdaybefore (pfile, days): "" " delete pfile
First, catch the exception1, try except# !usr/bin/env python # -*-coding:utf-8-*-num = input (" Please enter a number:")try: = Int (num) + print(int_num)except: Print (" you are not entering a number ")2. Capturing specific error
Written in the previous words:Get a background is a complete project supported by Python (flask framework), how to run it?Practice:First set up the operating environment:See another article, flask Getting started _windows installationAfter the
GeneratorThe result is saved to the state of the generator, and the yield in the normal function becomes the generator.1. Xrange in Python 3.3 has been merged into range.1 i = range (2)print (i)34 =>range (0, 10)2. Yield generator.1 deffunc ():2
This article mainly describes the use of Python to the list of key integers after the process of arranging, and to share the code to everyone, I hope you can give the drum applause ~ ~ ~
Problem
Defines a one-dimensional array of type int
This article mainly introduces the eight sorting algorithm of the Python implementation, the eight sorting algorithm detailed description and code implementation, interested in small partners can refer to
Python implements eight sorting algorithms
This article describes using Python to obtain Cisco configuration information automatically
From Netmiko import connecthandlerfrom datetime import datetimejtn_core={"Device_type": "Cisco_ios", "IP": " 172.16.5.254 "," username ":" Test ","
This article uses Python to write a method for a login interface
Demand:
Writing the Login interface
Enter User name password
Show welcome message after successful authentication
Lock after entering three times
User Information file
Blacklist of
This article describes using Python to read file applet
Ossysrexlwtfilelist = []filenum = BW = {}iops = {} (SUBSTRLISTSTR): flag = substr substrlist: (substr Str):
flag = Flag (STARTENDSTR): result = Re.findall (+START++END+STR)
Python Automation testing (2)
Principles of basic Automation technology
1 overview
In the previous article mentioned that: the primary ability to do automation is to look at the essence through the phenomenon , the implementation of the actual it
This article is a detailed illustration of the Python three-tier architecture
The three-tier architecture (3-tier architecture) typically has a three-tier architecture that divides the entire business application into:The presentation layer
This article describes the Python shutil module Learning Summary
Shutil name comes from Shell utilities, people who have learned or learned about Linux should be familiar with the shell, you can use this to remember the name of the module. This
Homework on March 10, March 2017
I. Functions of programming languages.
A programming language is a medium for communication between programmers and computers. It enables computers to execute commands to work.
2. Relationship between the operating
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