1. Simply print the log to the screen
import logginglogging.debug(‘This is debug message‘)logging.info(‘This is info message‘)logging.warning(‘This is warning message‘)屏幕上打印:WARNING:root:This is warning message
By default,
The first is a single underscore, which is often used in modules, variables and functions that begin with a single underscore in a module are treated as intrinsic functions by default, and if imported from a_module import *, this part of the
1. List of lists1.1 Slices# define a list.list = [1, 2, 3, 4, 5]Reads characters from left to right (the default step is 1). Such as:LIST[-2:-1] # Returns a list data type, [6]LIST[2] # returns an int data type, 3Reads the string from right to left (
Now there are five of them,A fifth person is two years older than the fourth, 18A fourth person is two years older than the third, 16A third person is two years older than the second, 14The second person is two years older than the first one, 12The
Installing VirtualenvTo develop with a Python virtual environment, you first need to install VIRTUALENV.Command: Pip install virtualenvInstall the virtual environmentCommand: Virtualenv venvActivating a virtual environmentCommand:
Introduction to the Python regular expression modulePython has added the RE module since version 1.5, which provides a Perl-style regular expression pattern. Previous versions of Python 1.5 provide EMACS-style mode through the Regex module. Emacs
Recognize and try PythonRemark: old boy python video tutorial, video from the network, here to share, invasion deleteFor me, the first week of the video mainly answers the following questions: 1. What are the three main features of Python?A:
On the server side, socket () returns the socket for listening (listen) and accept, which cannot be used to send and receive data between clients.Accept () accepts a connection request from a client and returns a new socket that differs from the
Download Pyserial Package Https://pypi.python.org/packages/source/p/pyserial/pyserial-2.7.tar.gz#md5=794506184df83ef2290de0d18803dd11Then unzip, for example, unzip to d:/pyserial. Open the CMD,CD command to switch to D:\pyserial. Execute
Using the Python re module, the RE module provides re.sub to replace matches in a string. 1 re.sub (pattern, Repl, String, count=0)Parameter description:Pattern: regular-heavy pattern stringREPL: The string to be replacedString: The original string
Module: PsutilPsutil is a cross-platform library that makes it easy for us to get information about the process and resource utilization of the system running.Function: mainly for the system monitoringInstallation:wget
Python is a cross-platform programming language that can run on all major operating systems. Linux is an operating system designed for programming, so Python should be installed by default on most computers that have Ubuntu installed.To determine if
Built-in functionsBuilt-in functions will check the parameters1 Print (ABS (-890)) # Seek absolute value 2 Print (Max (32, 63, 52342, 54)) # To find the maximum value 3 # type conversion function 4 Print (int (89.23)) 5 Print (Float (4))Custom
Python Basic Grammar This article is written by the baby himself Oh, hum, without consent, not reproduced, a little bit ... The firstthe baby version is Python2.7, environment Configuration What, on-line tutorial Super DA, Baby here is not more talk
A regular expression is a string that contains text and special characters that describe a pattern that can recognize a variety of strings.
? ? ? ? ? ? ? ? Regular expressions
?????????
????????? foo
? ? ? ? ?
Summary of differences between Single and Double underscores in Python and python underline
Preface
The Python code style is described by PEP 8. This document describes all aspects of the Python programming style. By following this document, the
Special class initialization methods in Python, python Initialization
What is a special method? When designing a class, python has a Initialization Method $ __init __$, which is similar to the constructor in java. This is a special method, also
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