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
Practice content:Determine if a binary tree T1 is a subtree of another binary tree T2. (T2>T1)Requirements: Time complexity O (N), Space complexity O (1)Body Content Summary:The 1.morris traversal implements the T1,T2 serialization of the first
If a strong standard library lays the groundwork for Python 's development, the rich third party libraries is the constant development of python, and with the development of Python some stable third libraries are added to the standard library, where
# This is a learning note for the Liaoche teacher Python tutorial1 , overviewAll variables are in memory during the program's run. But once the program is finished, the memory used by the variables is fully recycled by the operating system. And if
To use to package a. py file as an. exe file for othersInstall Pyinstaller, completeOpen CMD CallPath:\pyinstaller.exe-f path:\name.pyThe path to the published file is the current console window pathUse "" When executing a command path with a
# 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
# 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
# This is a learning note for the Liaoche teacher Python tutorial1. OverviewAdorners can help us add extra functionality to objects that already existAn adorner is essentially a Python function that allows other functions to add extra functionality
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 ,
# 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
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
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
1. And or not preferably in parentheses, first calculate parenthesesExecution order:Front to backResultsTrue OR ==>trueTrue and ==> continue walkingFalse OR ==> continue.False OR ==>false2. Several major symbols are categorizedThe result is a value:
The next act is to install the Python module gmpy2This module is used for high-precision calculation of the module, the individual according to the requirements, I often used to do RSA encryption algorithm calculationAs a shallow Ubuntu player, this
# This is a learning note for the Liaoche teacher Python tutorialCollections is a python built-in collection module that provides a number of useful collection classes .1, Namedtuplenamedtuple is a function that creates a custom tuple object ,
# This is a learning note for the Liaoche teacher Python tutorial1. OverviewPartial function is a function of the Functools moduleThe role of Functools.partial is based on an existing function. It is easier to call this new function by pinning some
#!/usr/bin/env python#_*_ Coding:utf8 _*_#### The script needs to be installed with fping command if no installation required fping#### Yum Install Fpingimport Osip = "10.10.0.1/24" ips = ["10.10.0.1/24", "192.16.17.27/24"] # Input List of
#Python 3.6#!/usr/bin/env python#-*-coding:utf-8-*-__author__='Bh8ank'Importxlrd" "=================XLRD is responsible for reading Excel, which is functionally read-only ===============================================" "myfile= Xlrd.open_workbook
Python file or folder operations
shutil This module provides a number of advanced multi-file and multi-file collections, in particular a function that supports file copying and deletion.1. folder and file operations
Import Shutil shutil.copyfile
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