Automated testing often writes data to the database and then reads the data from the database.Here's how to read data from a database.Prerequisite: The Mysql.connector module is installedThe established database is (under the Tet table in the test
DescribeThe Python Dictionary value () method returns all the values in the dictionary in a list form (not a direct list, to return a list value and also call the list function).GrammarThe values () method syntax:Dict.values ()Parameters
NA.
DescribeThe Python Dictionary keys () method returns a dictionary of all the keys in a list form (not a direct list, to return a list value and also call the list function).GrammarKeys () method syntax:Dict.keys ()Parameters
NA.
return
Reference Blog: http://www.360doc.com/content/14/0430/11/16044571_373443266.shtmlToday I suddenly think of python how to generate random numbers? Check it out, put out the test results.Import this module first1.random.random (): Randomly generates a
Python's update setBecause set stores a set of unordered elements that are not duplicated, the update set mainly does two things:One is to add the new element to the set, and the other is to remove the existing element from the set.when adding an
DescribeThe Python Dictionary update () function updates the key/value pairs of the dictionary dict2 to Dict.GrammarUpdate () method syntax:Dict.update (DICT2)Parameters
Dict2--A dictionary added to the specified dictionary dict.
return
There are two collection types in Python, mutable collections, and immutable collections. The Create collection is performed using the SET command.The following are common commands for a = set (' Boy ') collection:
Command type
#Coding:utf-8ImportRes= u" "More or less reading a good book Chainsaw Nightmare 20202 and utilities after the time 1212 confiscated to the wind 10.12 sea big rich is pink and method of 1244525.000 will take place of the pink legalization good 0.01
Python does not require curly braces to distinguish logic like other languages, and it only uses the TAB key (the default four spaces) to differentiate the code. Like whata = input (' please input a num: ') b = 0 if int (a) > b : Print('
There are four parameters of the function, positional parameter, default parameter, variable parameter and keyword parameterdefFunc (x, y=0, *arg, * *args):" "x is the positional parameter Y has a default value of *arg variable parameter **args as
View Help for Python
When we want to see which data type a python variable belongs to, we can use:Print (type (variable))When we want to see the specifics of a variable there are those methods:Variable = dict (a=1,b=2)Print (dir (variable))This
DescribeThe Python tuple tuple () method converts strings, lists, dictionaries, and so forth into tuples.GrammarTuple () method syntax:Tuple (SEQ)Parameters
SEQ-the sequence to convert to tuples.
return valueReturns a tuple.InstanceThe
Python learning summary, python Summary
Iterator: def gen (): a = 100 yield a = a * 8 yield a yield 1000for I in gen (): print (I) to create a function, loop body, yield returns a value after the loop. Call the function to print the cyclic result: 10
Basic Python serialization knowledge (json/pickle), jsonpickle
We call the process of changing objects (variables) from memory to stored as serialization, such as XML, pickling in Python, and serialization, alling, and flattening in other languages,
Create a binary tree in Python exploration, and explore a binary tree in python
Problem
Create a binary tree
A set of multiple nodes in a binary tree. This set may be:
Empty set
It is composed of a root node and a binary tree that does not
Python exploration: modifying the Python search path and exploring the python search path
When Python executes the import Statement, it searches for the Python module and extension module in some paths. You can view these paths through sys. path,
Python implements paging, and python implements Paging
The examples in this article share with you the code for displaying the page Effect of python for your reference. The specific content is as follows:
Difficulty: Clear Layout
#! /Usr/bin/python #
In the lower-right corner of python + pyqt implementation dialog box
This article shares the code in the pop-up box in the lower right corner of the pyqt implementation for your reference. The details are as follows:
In the constructor:
Self.
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