Discover full stack development book, include the articles, news, trends, analysis and practical advice about full stack development book on alibabacloud.com
In CSS, all HTML elements can be viewed as a box.So in the design and layout, the most commonly used, that is, to define the margin of the box is marginDefining the inner margin of the box is padding.The width of the element's content is set by the wide property, so what is the total width of the element in the HTML page?is width + padding-left + padding-right + border-left-width + border-right-width This is the total width of the entire HTML page that the element occupies.For borders, we can us
Lists are divided into ordered and unordered listsWe know that the label of the sequence list is The label of the unordered list is The labels for each item in the list are wrapped in You can use a list style in CSS to not only change the list item markers for a list, but also to use a picture as a list item marker.can be usedList-style-image: url('sqpurple. GIF'); To set the list item to be marked as a picturecan also be usedList-style-type: none; To set the flag type of the list item,
CSS statement.Without selectors, there is no CSSSelectors are used to select things in an HTML page, and then we'll specify the colors and styles after selecting them.The first thing we want to introduce isID SelectorAs we all know, the HTML tag has an id attribute, the id attribute is unique, then we can select a specific tag by the CSS ID selector, and then specify the style of the tag.So how does our ID selector be declared in CSS?Use the # number.That's it, #号, remember.For example, if the
end and back end.HTML is the front-end, as the customer's browsing interface, PHP is executed on the server side of the program, is the backend, this through the case to deepen our understanding of the front-end and back-end, browser-side and server-side.And then after this interaction, the next thing we do is the interaction between PHP and MySQL, that is, to save the PHP value to the server-side database based on this case.You know, if we do not save, then each time we get the data will disap
databases; +--------------------+| Database |+--------------------+| information_schema | | mydb | | mysql | | performance_schema | | SYS |+ --------------------+5inset (0.00 sec)You can see the database we created MyDBmysql> use mydb;database changedmysql> show tables; +----------------+| Tables_in_mydb |+----------------+| User |+----------------+1inset (0.00 sec)You can see that the database mydb has our data sheet userThen we'll
inheritance order, there is a situation and py3 different, such as, where bar does not inherit object (classic Class), depth first, other cases, are breadth first # Py27class Bar (): def F1 (self): print (' Bar ') class A (bar): def f (self): print (' a ') class C (a): def f (self): print (' C ') class B (bar): def F1 (self): print (' B ') class D (b): def F1 (self): print (' d ') Class E (c,d): def f (self): print (' e ') e = e () e.
() function, printing the ' F function ' >>end # f function finished, then execute the INNER1 function inside the print (' End ') >> End # Finally execute the INNER2 function inside the print ( ' End ')4, with parameters of the adornerThe front of the adorner itself without parameters, if you want to write a parameter of the adorner, then we need to write a three-layer adorner, and the front of the adorner is not too standard, the following to write a comparison specification with parameters of
Python full stack development-Day10 decorator (closed function application), python-day10I. decorator
The decorator is an Application Scenario of closure functions.
What is a closure function? Let's recall:
Closure functions:
A function defined within a function. The function contains a reference to the external function scope (emphasizing that the reference to t
Python full stack development-Day9 function object, function nesting, namespace and scope, python-day9I. Function objects
1. functions are the first type of objects, that is, functions can be passed as data.
1 can be referenced 2 can be passed as a parameter 3 return value can be an element of function 4 can be used as a container type
Ii. Use this feature to ele
Python full stack Development 5. Several Common sorting algorithms and the data structure provided by the collections module, pythoncollections
During the interview, I often encounter some questions about the sorting algorithm. Here, I simply listed several of the most common sorting algorithms for you to learn. Maybe the interview will be useful in the future, t
Python thread pool and process pooling for concurrent application# thread pool requires imported module from Concurrent.futures Import threadpoolexecutor# process pool requires imported module from Concurrent.futures Import Processpoolexecutorimport time# test Function def task (ARG): print (ARG) time.sleep (1) # Instantiates a thread pool object with a maximum concurrency of 10pool= Threadpoolexecutor #pool. The submit parameter is a function and the parameter is passed for I in range:
Team7 Print(Queue_l.pop (0))8 Print(Queue_l.pop (0))9 Print(Queue_l.pop (0))Ten Print(Queue_l.pop (0)) One Print(Queue_l.pop (0)) A Print(Queue_l.pop (0))5, del, remove delete1 del # Simple Delete 2 hobbies.remove ('eat'# Simple Delete, and is the specified element to remove6. Len Lengthdetermine the default first length of the list hobbies=['play','eat',' Sleep ','study']print(len (hobbies))7. In contains 1 Determines if the sleep element exists with hobbies in the return true, return false
1, locals, globals1 def func (): 2 x = 13 y = 24print (Locals ()) # Prints the name in the local scope 5 Print# Prints the name in the global scope2.1 Print(123)2 "print (456)" #string3Eval"print (456)")#convert string to Python code to execute4 5 Output Results6123755W81exec("print (789)")91 num = 1+2+3Ten2 num = eval ("1+2+3")#execution will perform operation with return value One3Print(num) A4 -5 6 -1 num2 =exec("4+5+6")#executed, but no return value the2Print(num2) -3defmy
fromMultiprocessingImportProcessdeffunc (num):Print("In func", Num,os.getpid (), Os.getppid ())if __name__=="__main__": Print("In main", Os.getpid (), Os.getppid ()) P=process (target=func,args= (1,)) P.start ()Print(P.is_alive ())#True to detect whether the process is performing a taskP.join ()#blocks wait for the child process to finish before executing the subsequent code Print(P.is_alive ())#False The child process task has endedP.terminate ()#force End Child process non-blocking P
((6,6,6,6,6,8,8,8,8,8,8,))B=counter ({"Name": "Alex", "name": "Eve", "name": "Mary"})print (c) # Counter ({' H ': 6, ' F ': 6, ' G ': 4, ' d ': 3}) returned as a dictionaryprint (d) # Counter ({2:4, 3:4, 4:4, 1:1})print (e) # Counter ({8:6, 6:5})print (b) # Counter ({' name ': ' Mary '})three. Random1.random (+)#0到1之间的小数2.uniform (1.3)# more than 1 decimals less than 33.randint (1,5)# 1=4.randrange (1,10,2)# 1 to 10 odd Gu Tou regardless of tail5.choice ([1, "23°c", [4,5])# There must be an ind
, and so on, all variables, classes are marked during execution, and after execution, they are automatically reclaimed for a period of time without being called.class A:def __del__ (self):print ("666")a1=a ()a1.__del__10.__new__ Usageclass A:def __init__ (self):self.x=1print ("in init function") # Fifth Stepdef __new__ (Cls,*args,**kwargs): # The second step automates the __new__ methodprint (CLS) # Third Step print ("in new Function") # Fourth Stepreturn super (). __new__ (CLS) # Returns an obj
in iterable if condition) # Filter ModePros: 1. Save codeCons: Bad troubleshootingOverall: Generally used in a list deduction structure, in other ways can also, very complex list, list derivation is not constructedBuilt-in functions1.1 Scope-relatedA =33b = 22def func (): a = 1 print (Globals (), ' \ n ', locals ()) func ()1.21 Other relatedExecution of String type code Eval,exec,compliePrint (eval (' 1*2*3*4*5*6*7*8*9 ')) Li = "" For I in Range: print (i) "" "Exec (LI)1.22 input and o
))yield "222"Gen=func () # If there is yield in the function, this function is the generator function ret=gen.__next__ () # generator is essentially an iterator that can be executed directly __next__ () print (ret)(2) The difference between yield and return.#there is yield in the program, the function is the generator function, the access generator function, the function does not execute, returns a generator.# The generator executes __next__ and executes to the next yield.# yield and return are
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.