SQLAlchemy is a Python ORM framework.There is a flask-sqlalchemy extension in flask, which is convenient to use.1. Create a sqlalchemy model moduleTo create a models.py moduleWhen creating the model, first introduce the extension of Flask-sqlalchemy
common data types for PythonA= 10 Integer typeb=10.0 floating Point typec= "Hello" stringD=true Boolean True/falesApplication methodInteger:A=1Print (a)Floating point number:b=2.0Print (b)Boolean:Print (B>a)TruePrint (BFalesString:C= "Hello,tom"Find:
The realization of the simple shopping procedure. (initial version)1 #简易购物程序2 3Money =200004Goods_list = ['IPhone 8','Bicycle','Banana','Xiaomi Note','MacBook','Mineral Water']5Goods_price = [9000, -, -,3200,12000,5]6Print"Welcome to Smart Mall! You
1, *args dynamic parameters, universal parameters*args is to accept the remaining positional parameters corresponding to the arguments and place them in the tuple. When defining a function, *args represents an aggregation.def func (*args):
int (integral type)The number of integers is 32 bits and the value range is -2**31~2**31-1, which is -2147483648~2147483648Long (integer)Unlike the C language, Python's long integers do not refer to the positioning width, i.e. python length does not
Depth copy
= = Compares the contents of the data, if it is true that the content is the same, the reference is different= After the operation is executed, the reference address of the front and back two elements is the sameShallow copy copy ()
1. Named keyword parametersFormat: Parameters after * are named keyword parametersCharacteristics:1. Must be transmitted value2. The caller of the constraint function must pass the value in the form of Key=value3. The caller of the constraint
#first import the OS packageImportOS#引入time模块是因为需要将浮点型的时间转为东八区时间Import Time#basename (path), remove the path name and return the file name separatelyf = os.path.basename ('E:/python/day-2/test.txt')#the output is Test.txtPrint(f)#dirname (path),
1. Download and install Python2. Verify that the Python installation is successful or not3. Selenium installation via PipIn the command line that you just opened, enter: Pip install SeleniumThis will install the latest version of selenium by default,
Brief introduction
Installation
Development tools
Tips for using development tools
Example
Quick development (shortcut keys)
About 0X01
How popular Python is--ranked top five-a language that must be mastered
Tag: Image stat enters the latest version. COM source code mode installation NloadFirst, install Python1. Install under LinuxThe general system is installed by default 2.6.6 version, upgrade to 2.7 version, but 2.6 can not be deleted, because the
One: Use of the RE moduleIn Python, when you need to match a string with a regular expression, you can use a module reRe module use process:Import re #导入re模块result = Re.match (regular expression, string to match) #使用match () method to match, or none
Note: In Python, non-0 values indicate that True;none and 0 represent False.If statementIf...else statementsIf...elif...else statementsNested IF statementsYou can add an if ... else statement to another if ... else statement, which is called nested.
Example the URL set for a Web site is thisHttps://www.555zw.com/book/40/40934/10334793.htmlHttps://www.555zw.com/book/40/40934/10334794.htmlHttps://www.555zw.com/book/40/40934/10334795.htmlHttps://www.555zw.com/book/40/40934/10334796.htmlHttps://www.
One, Python data typeinteger intStringLists List1, the list can be modified2. The list contains multiple strings3. The list can be indexed, sliced, indexed starting from 0, 1 for right-to-leftadd element functions to the list:Append (value) adds an
This article is mainly to share with you the Python iteration model examples, mainly in the form of code and we share, hope to help everyone.
#-*-Coding:utf-8-*-"" "Created on Thu Mar 11:43:05 2018@author:mz" "" Class Iterator (object): Def Next
Install pip and centospip in centos1. Download pip
[Root @ localhost ~] # The curl https://bootstrap.pypa.io/get-pip.py-o get-pip.py% Total % Received % Xferd Average Speed Time CurrentDload Upload Total Spent Left Speed100 1738 k 100 1738 k 0 0 456
Python learning-local time and UTC time, python learning utc time
The conversion and processing of local time and UTC time has been plagued for a long time until many others have learned a lot in one blog, which is recorded here.
From:
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