1.python IntroductionPython founder: Guido van Rossum, hailed as a benevolent dictator in the Python world.Borrowed from the Unix shell, C features1989 Christmas period, Python has been 20 years of history, much earlier than Java, the first version
1. Function callsA = []def fun (a):A.append (1)Print (a)This time the result of the output is [], if you want to appear 1, you need to run the function fun first, and then in the output a2.python methoddef demo1 (x):Print ("My is one demo" +x)Class
Emailregex = R"[-_\w\.] {0,64}@ ([-\w]{1,63}\.) *[-\w]{1,63}"= Re.search (Emailregex,"str")The characters in the user name include uppercase and lowercase letters, underscore _, Arabic numerals, and dot. and has a length limit of {0,64}, limited to [
Dynamic strongly typed:
Dynamic type language: The language of type checking at run time, that is, you can write code without specifying the data type of the variable, such as Python and Ruby
Static type language: Its data type is checked
install Python on WindowsFirst step: Download the installation packageDownload the corresponding Python version from the official Python website based on the Windows version (64 or 32), this time using Python V3.5.Download path:
Recently, a small project has reached the end of the stage. Want to add write log mechanism to increase the judgment analysis after the program error. An attempt was made to use the Python logging
Socket explanationSocekt, also known as a ' socket ', is used to describe IP and address ports, which is a handle to a communication link, and an application typically makes a request to the network via a socket or answers a network request.Sockets
Python3 socketPython provides two levels of access to network services. :
The low-level network service supports the basic socket, which provides the standard BSD Sockets API to access all the methods of the underlying operating system
Create a socketserver at least in the following steps:
First, you must create a request handler class by subclassing the Baserequesthandlerclass and overriding its handle () meth Od This method would process incoming requests.
Second,
In Python, you parse the block of code by indentation, paying special attention to tab and space characters, which cannot be mixed, usually with four spaces instead of the TAB keyHere's a simple example to illustratePrompts the user to enter work
1.socket () module functionYou use the Socket.socket () function to create a socket. Its syntax is as follows:Socket.socket (socket_family,socket_type,protocol=0)Socket_family can be the following parameters:Socket.af_inet IPv4
Introduced
Design Patterns are a set of reusable, most known, categorized purposes, code design experience Summary. Design patterns are used in order to reuse code, make code easier for others to understand, and ensure code reliability. There
From a lighter level, Python's memory management mechanism can be used in three ways.(1) Garbage collection(2) Reference count(3) Memory pool mechanismFirst, garbage collection:Unlike languages like C++,java, Python can assign variables directly
#-*-coding:utf-8-*- #===============================================================================# Directory Comparison tool (contains subdirectories), and lists# 1, a more than B what files# 2, b more than a what files# 3, the same files: File
1.geopy Package Download location https://pypi.python.org/pypi/geopy2. Installation StepsRun cmd, switch to d:/python/geopy-1.11.0/directory (modified according to your own extracted directory and download version number), CD d:/python//geopy-1.11.0
Python & BinaryTree
1. BinaryTree (binary tree) a binary tree is a set of finite elements that are either empty or have an element called the root node (root) and two disjoint two-tree trees, each of which is called the Saozi right subtree.
Python + Interface for O & M alarm, python
When it comes to O & M alarms, I think we can write a long history to explain in detail the past generation of alarms. For example, the earliest alarms were sent via emails, but the real-time emails were
Python built-in functions locals and globals (learning notes), pythonglobals
Python built-in functions-locals and globals
These two functions provide dictionary-based access to local and global variables.To understand these two functions, first
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