One, the use of character encoding:1. Text EditorUnicode----->encode-------->utf-8Utf-8-------->decode---------->unicode Add:When you browse the Web, the server converts dynamically generated Unicode content to UTF-8 and then to the browserIf the
First, the basic syntax:1. Note: #Print ("Hello" + "world") #这是个print2. DigitalIntegers: Do not differentiate between long and int
Binary: 0xa (16-binary), 0o10 (decimal), 0B10 (binary) bool, two values: True, False
Floating point
Ordinary strings in the py2.7 are ASCII-encoded, for example, str= "ABC", if it contains Chinese will be GBK or gb2312 code (GB2312 is the Chinese provisions of Chinese character coding, also can be said to be Simplified Chinese character set
1. UI test Framework Setup-directory structure2. Introduction of documents2.1, baseinfo->__init__.pyconfiguration file Definition Base parameters#-*-coding:utf-8-*-#test Case Configuration
1, slicing operation:Str[start:end:step]Including head, not including tailStep is step, meaning every step-1 element, take one character"While" [::-1] Reverse string, implement string inversion-"ELIHW"2. Method:The decoration of the string:Center:
The 6th chapter mainly exercises the various dictionaries, the following contentWhat is a dictionaryRelationship of key-value in dictionaryA simple dictionary.Find its corresponding value by using the keys in the dictionaryAdd a key-value to the
SH is a better library than subprocess, capable of executing shell commands1. View IP:[Email protected] myblog]# ifconfigEth0:flags=4163 MTU 1500inet 172.31.253.193 netmask 255.255.240.0 broadcast 172.31.255.255Ether 00:16:3e:01:72:ac Txqueuelen
Common data types in Python are: integers, floating-point numbers, strings, lists, tuples, dictionariesPython can omit declarations from other languages, and can directly define assignment usage.For example:A=12 is equivalent to int a=12 omitted in
# test for DictPrint (' ==========start Test dict========== ')names = [' Aa ', ' Bb ', ' Cc ']Scores = [98, 76, 54]# # D is equivalent to making a map mapD = {' Aa ': 98, ' Bb ': +, ' Cc ': 54}Print (' d is ', D)For name in Names:Print ('%s is '%
1. ReliancePyenv installation using Git# yum Install git-y# yum-y install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2- Devel2. Create a user python# useradd python# passwd python3. Sign in with a Python
The compiler compiles each statement of the source program into a machine language and saves it as a binary file so that the computer can run the program directly in machine language at a very fast speed.And the interpreter is only in the execution
"Example 1" 1.usa.gov data from bit.ly1. File Location Description:Forward slash \ Backslash \ mixed with all can. such as path= "D:/python/ch01.txt"First of all, the problem encountered is pycharm Chinese coding problem, note ideencoding changed to
Strip (RM) is used to delete white space characters within an element:RM corresponds to the element for which you want to remove whitespace, and when RM is empty (strip ()), the whitespace of all elements is removedStartsWith, endswith the element
"Prerequisite Summary"Django is also a popular web framework that is much more complex than flask. Django iterations are updated very quickly and frequently, so there are some obsolete things that need to be discarded, and something new needs to be
Excerpt: Https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/ 001432004977916a212e2168e21449981ad65cd16e71201000TCP is to establish a reliable connection , and both sides of the communication can send data in the form
Here is an example of a Python level three menu for everyone. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
Requirements:
Print provincial, city, and
Python-List Application-name management system and python-Management System
Code:
1 #1 print function prompt 2 print ('=' * 50) 3 print ('name relational system v1.0') 4 print ('1: Add a new name ') 5 print ('2: delete a Name') 6 print ('3: change a
Python monitors linux memory and writes it to mongodb and pythonmongodb
(You need to install psutil to obtain server resources and pymongo driver) # pip install psutil
# Pip install pymongo
# Vim memory_monitory.py
The file content is as follows:
#
Python random number detailed use, push to and string, two-color ball applet, python two-color ball
# Use of random numbersImport random # import randomRandom. randint () # specify a random number ranging from 0 to 9.I = random. sample (range (), 6)
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