JSON (JavaScript Object Notation) is a lightweight data interchange format. It is based on a subset of ECMAScript. JSON takes a completely language-independent text format, but also uses a similar idiom to the C language family (c, C + +, Java,
Requirements: When recording, you need to click to start recording, but there has been a colleague hand shake, no recording phenomenon, so the leader wants me to write a script, you can detect if not to start recording, then send SMS alarm, the
Integers divide with integers:
>>> 2/50>>> 2.0/50.4>>> 2/5.00.4>>> 2.0/5.00.4>>> 7/23>>> 7.0/23.5>>>Note: integers divided by integers result in integers (the quotient);For example 7/2, quotient is 3 (integer), the remainder is 2, and the
We know that the area of the circle is calculated as:S =ΠR2When we know the value of radius r, we can calculate the area based on the formula. Suppose we need to calculate the area of 3 circles of different sizes:R1 = 12.34R2 = 9.08r3 = 73.1S1 = 3.14
List: slices, indexes, references
Build list: a=[1,2,3]
references:a_ref=a, and a point to the same address
List common actions:copy operation b=a[:]
A.append(3): Add an element after list a
A.insert(1, 20): Inserts 20 into the 1
The difference between From...import and import is that import imports the specified library directly, whereas From....import imports the specified module from the specified library.Import...as is the import a as B, giving a library a nickname for a
Description: Convert ' Telecom 4-8,11 District ' to the following form ' Telecom Zone 4-Telecom 5 District-Telecom 6-Telecom 7-Telecom 8-Telecom 11 district '.Import restring = input ("Please enter game area:") T1 = String.Split (', ')
First, object-oriented learning characteristics
Class
A class is an abstraction, a blueprint for a class of objects that have the same properties. Prototype. The properties and common methods of these objects are defined in the
#!/usr/bin/env python #-*-coding:utf-8-*- Count = 0 Flag = 0 #提示用户需要做什么操作 option = Int (Input (" Hint: The number 1 is the registered user, the number 2 is the login system, select: ")) If option = 1: user = input (" Please enter user name:
Object-oriented programming (OOP)program = instruction + dataTwo types of paradigmsProcess oriented:Command-centric: writing around "What's going On"The program has a series of linear steps; The main idea is that code is used for dataObject-oriented:
English documents:
delattr
( object , name )
This is a relative of
setattr () . The arguments is an object and a string. The string must be the name of the one of the object ' s attributes.
I'm going to do something recently, not before the optimization. It takes 11 hours to run once. When running to see the CPU, memory is rich, consider using Python multithreading to do.Multi-threaded If you can save time, but also to wait for the IO,
1. webdriver principleWebdriver is designed according to Client/server mode, theclient is our test code, sends the request, theserver is the open browser to open the client's request and respond. Specific work Flow:· Webdriver opens the browser and
Ulipad is a very useful Python editor, of course, many friends with vim or gedit can, see personal habits.
First, download the Ulipad 4.1 compressed file http://down.51cto.com/data/630118
Unzip to the/tmp/directory
cd/tmp/ulipad/
1. If statement1.1 FeaturesThe IF statement is primarily used to react differently to changes in ambient conditions (i.e., expession) (I.E. execution Code)1.2 Syntax1.2.1 Single branch structureIf single branch single condition:if
Programming 0 Basics How to learn PythonIf you are 0 basic, note is 0 basic, want to get started programming, I recommend you learn Python. Although the country is basically a C language as an introductory instruction, but at MIT and other foreign
Mode key-value:dict={' xiaoming ': all, ' xiaohaong ':, ' Xiaomao ': $, ' Xiaoli ': 54};
Use the constructor to build the dictionary dict (tuple)/dict (a=1,b=2,c=3), zip to generate a dictionary of two identical lengths of list dict (zip
Python built-in functions (20) -- exec, python built-in function exec
English document:
exec(
Object[,
Globals[,
Locals])
This function supports dynamic execution of Python code.
ObjectMust be either a string or a code object.
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