Character encoding
Variable = u "x"U: represents UnicodePython3 will become bys byte type after transcodingCase1 #-*-CODING:GBK-*-2A ="Hello"3 Print(a)4 Print(A.encode ("GBK"))5 Print(A.encode ("Utf-8"))6 Print(A.encode ("Utf-8"). Decode (
0.1. ReferencePython Regular Expression GuideHttps://docs.python.org/2/library/re.htmlHttps://docs.python.org/3/library/re.html
String
Re
Note
Re.match (Pattern, string, flags=0)
At the start of
One, Psutil module1. Psutil is a cross-platform library (http://code.google.com/p/psutil/) that makes it easy to get the process and system utilization (including CPU, memory, disk, network, etc.) information of the system running. It is mainly used
List:1. an orderly set;2. Index by the offset to read the data;3. Support nesting;4. Variable type;List of actions:1. Slices:A = [1,2,3,4,5,6,7]Forward IndexReverse IndexDefault Index2. Add an action1) + Generate a new list;2) Extend accepts the
Count the number of words as a dictionary store" Who has an apple Apple are free know " = {} for in Content.split (""): ifin Result: + =1 else: = 1Print resultReverse the above resultsres = {}For k,v in Result.items
This system all uses the Python basic knowledge realityProgram StructureAtm|--readme|--ATM #ATM主程序目录| |--__init__.py| |--atm.py #ATM执行程序| |__manage.py #ATM管理端--management portal for adding users, modifying quotas, and freezing accounts| || |--conf
Python Punch the first day:What Python is, I believe a lot of online search, here I do not introduce. Here is my study record:learn a programming language, first of all to understand the history of the development of the language, and then began to
Python's logging module one, simple to print the log to the screenImport LoggingLogging.debug (' This is debug message ')Logging.info (' This is Info message ')Logging.warning (' This is warning message ')The output is WARNING:root:This is warning
First, enumerateEnumerate,for I in enumerate (an iterative object), returns a tuple with the contents (serial number, each element that can be iterated)For I,j in enumerate (Can iterate object, start serial number), return serial number, iterate
There are lots of python open source frameworks , like Django, Flask, webpy, etc., but which ones are most commonly used? We have collected some valuable comments from Python users and simply introduced the Python open source framework that they
1. Use the string function replacea = ‘hello world‘>>> a.replace(‘ ‘, ‘‘)‘helloworld‘
1
2
3
4
It is really stupid to look at this method.2. Using the String function splita = ‘‘.join(a.split())>>> print(a)helloworld
strings, numbers, lists, meta-ancestors, dictionaries convert each otherWhat is the conversion between 1 Int and STR, and what is the result of the transformation? Is there a condition? #str (int) can be converted to str the process has no
= = Types Module = =The ' types ' module contains all types of type objects defined by the standard interpreter, such as [Example1-86#eg-1-86] as shown. All objects of the same type share a type object. You can use the " is"To check whether an
To download the officialdom romance fiction as an example: Specific code:#Coding=utf-8ImportOSImportRe fromSeleniumImportWebdriver fromSelenium.common.exceptionsImporttimeoutexceptionImportSelenium.webdriver.support.ui as UIImport Time
PythonEnvironment ConstructionIn this section we will show you how to build a python development environment locally.Python can be applied to multiple platforms including Linux and Mac OS x.You can enter the "python" command from the terminal window
In a Windows system, the path uses \. While the Linux system, the path uses/. \ is also an escape character, so there is a problem when using \.If the luck is good, \ can not be escaped after the character, or can output normally:Print ("C:\Program
Arrow is a time-and-date library, simple and easy to use. Support python3.6Https://arrow.readthedocs.io/en/latest/arrow Official Website APIHttps://github.com/crsmithdev/arrow Arrow's GitHub hosted addresshttp://www.iplaypy.com/module/m111.html
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