I. Integrity constraintsConstraints are similar to data type widths and are optional parameters that are used primarily to ensure data integrity and consistency.1, NOT NULL and defaultNull is nullable, the table defaults to null, and empty content
[Exercise] Specifies a source file that implements copy to the target directory.Like copying/tmp/sample1.txt to/tmp/sample2.txt.The original file needs to have Read permission (the default RT permission), the target file needs to write (w)
Content Summary1.__str__2.os.path Related methods1.__str__Let's first define a Student class and print an instance:1 class Student (object): 2 def __init__ (self, name): 3 Self.name = name45print Student ('Michael' )0x109afb190>Print out
# @Time # @File Example 1:range () consumes memory when open#range ([Start,] stop[, step]),Generates a sequence based on the range specified by start and stop and step set by step print range ( 5) print range (1,5) print range (1, 5,2) >>> [0,
Print source, the parameter end default value is a newline character, need to be set to empty, it will achieve the effect of printing a lineImport Time for in range: time.sleep (1)#sleep one second and then output # The data to be
It is a waste of memory and time to parse the entire document just because you want to find the tag in the document. The quickest way is to ignore the tag from the start. The Soupstrainer class can define a section of a document so that it does
1. Indentation and syntaxPython Indents and colonsPython is simple because of his indentation and the colonA = 100If a > 10:Print (' 11111 ')Print (' 22222 ')"Note Indent distance"2.if condition judgmentFormat:If judging condition:Execute statement .
First, help If you want to know more about an object, you can call Help (object)! There are also some useful ways that Dir (object) will display most of the relevant property names for that object, and Object._ Doc _ will display its corresponding
I. If Else1.if StatementsIf expression://Note If there is a colon after, there must be Statement (s)//4 spaces relative to if indent Note: Python uses indentation as a method of grouping its statements, and it is recommended to use 4 spaces2.
Although Google is now the boss, Python naming is often followed by Google, but the individual still feel that the camel name and underline mixed together a little uncoordinated.Or simply underline, but the more you hit an underscore is the cost of
Python type conversionFunction descriptionint (x [, Base]) converts x to an integerLong (x [, Base]) converts x to a long integerFloat (x) converts x to a floating-point numberComplex (real [, Imag]) creates a complex numberSTR (x) converts an
OneTo force type conversions:Factory functions are generally available when specific conditions are metList ()STR ()Tuple ()......Convert the data type to the type you want1. Cast the number to a string:Number---STR:STR (number)TwoPython3 in bytes
1. Debug (PDB)Code: [[email protected] Gaoji]# vim test2.py 1 # !/usr/local/bin/python3 2 # -*-coding:utf-8-*- 3 4 def Getaverage (A, B): 5 result = a + b 6 print (" result=%d " %result) 7 return result 8 9 A = ten B = 2 XX C = a +
Python official website Download: https://www.python.org/downloads/Download slow access to Soho download Source: Http://mirrors.sohu.com/pythonPython3 The latest version is 3.6, but most of the code still uses Python2, so install the latest python2.7
I follow the book, summarize the implementation to record, do not feel simple to try, knock a code. Executive power is the sword of a good programmer. If you are a novice in mastering other language situations such as Java, C or PHP and so on any
The operation of files, folders (file manipulation functions) in Python involves both the OS module and the Shutil module.Get the current working directory, that is, the directory path of the current Python script work: OS.GETCWD ()Returns all files
Syntactic Statement division operations (Precision and truncation operations)In Python2, the division operation is usually truncated division. What is truncated division:>>> 3/40 # automatically ignores decimal itemsWhat if you want the right
My first python web development framework (12) -- tool function Package Description (3), pythonweb
Mail_helper.py is a mail operation package used to send emails.1 #! /Usr/bin/evn python 2 # coding = UTF-8 3 4 import smtplib 5 from email. mime. text
Table operations,
Reading directory
Table introduction
1. Create a table
2. view the table structure
Three Data Types
Table 4 integrity constraints
5. ALTER TABLE
6. Copy a table
7. delete a table
Table introduction
A table is
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