This article mainly describes the Python meta-class instance resolution, the main task of this article is to give you a thorough understanding of what is a meta-class, the need for friends can refer to the next
Uncle Turtle invented Python and then integrated a bunch of concepts into the language, such as: iterators, decorators, functions, generators, classes, objects, and so on.
These concepts do not seem
loop structure, and the template meta-Program is interpreted by the compiler at compile time.Pros and cons and applicable situationBy moving the calculation from the runtime to the compile time, do as much work as possible before the result program starts, and eventually get faster programs. This means that the advantages of template meta-programming are:1. At the cost of compile time for excellent run-tim
have been accustomed to the use of META tags, and really seriously understand, at least the English meaning has not yet figured out ... Here's an excerpt from the network: Interactive Encyclopedia: Elements can provide meta-information (meta-information) for related pages, such as descriptions and keywords for search engines and update frequency. The label is loc
Set title: This. header. Title = "this is a title test ";
If masterpage is used, you can use this. Page. Title = sitemap. currentnode. title;
Set style dynamically:
Style = new style ();
Style. forecolor = system. Drawing. color. Navy;
Style. backcolor = system. Drawing. color. lightgray;
// Add the style to the header for the body of the page
This. header. stylesheet. createstylerule (style, null, "body ");
Dynamic style sheets: htmllink link = new htmllink ();
Link. Attributes. Add ("type", "t
With HTML5 's popularity and web technology evolving, the META tag team is growing, from Windows XP IE6 to today's Windows 7, Windows 8 IE9, IE10, IE11, support for HTML5 is getting better, html Meta tags also function more and more powerfully.First, let's start with some common meta tags that were originally generated. Start with the definition of
#元组 elements can not be modified, not added or deleted## li = [11,22,12,33,134]# Tu = (11,22,33,44,556,32,67,)#一般写元组的时候最后加一个逗号#tuple#索引# v = tu[0:4]# print (v)#可以被for循环 Iterate objects# for I in Tu:# Print (i)#字符串转换 tuples# s = "dlkagje1232"# TU1 = tuple (s)## TU2 = Tuple (LI)## Print (TU1,TU2)#元组转列表 string## Tu = (11,22, "$", "ALDs", "DFPK")## li = List (TU)# Print (LI)## s= ""# for I in Tu:# s = s + str (i) #注意要把数字, convert string# print (s)## TU1 = ("212", "SDF")# S1 = "_". Join (TU1)#
, (), 44,55, (4,5)) v=tu[3][0]print(v)Operation Result:1Tuple-level elements cannot be modified, added, deleted, level two elements can be modifiedtu= (11,22,33,[)],44,55, (4,5)) tu[3][0]=22 #[3][1] will error #tu [3] represents [[+]] This element, [0] On behalf of (A/a)print(TU)Operation Result:(11, 22, 33, [22], 44, 55, (4, 5))Example two:Tu= (11,22,33,[), (4,5,6)],44,55, (4,5)) tu[3][1]=22print(TU)Operation Result:(11, 22, 33, [(1, 2, 3), 22], 44, 55, (4, 5)The tuple itself comes with a func
)Print (v)Operation Result:V1DIC = { ' K1 ': ' V1 ', ' K2 ': ' v2 '}v = dic.pop (' K1 ')#3. Delete and get valuesV1 = Dic.popitem ()#随机删除Print (v1)Print (DIC,V)Operation Result:{' K2 ': ' V2 '} v1(' K2 ', ' v2 ')#4. Set the value, if it already exists, do not set, get the value corresponding to the current key#不存在, set, and get the value corresponding to the current keyV1 = Dic.setdefault (' K1 ', ' 1234 ')V2 = Dic.setdefault (' kk1 ', "1234")Print (V1,dic)Print (V2,dic)Operation Result:v1
2.3If substitutionThe IF statement is executed at compile time and can be implemented in a template-specific way. Here is the calling code:Test ifcout The output is:Test Ifit ' s falseThe implementation of the template class is as follows:TemplateC + + template meta-programming four: If statement runs at compile time
List and elements of Python:In common: orderlyDifference: 1. List can be modified add delete list content, tuples cannot be modifiedContact: The element in the tuple that contains the list, you can modify the list element.Analysis: 1. List: list1=[1,2,3,4,5,6] Object LIST1 contains multiple elements.2. List related functions: Len (List object) Gets the number of list elements;The list is appended with the element list object. Append (additional elements);List Append List object. Extend (the obje
(' A ', ' B ', [' X ', ' Y '])This tuple is defined by 3 elements, namely ' a ', ' B ', and a list. Doesn't it mean that once a tuple is defined, it's immutable? Why did you change it later?Don't worry, let's take a look at the definition when the tuple contains 3 elements:When we modify the list's elements ' A ' and ' B ' to ' X ' and ' Y ', the tuple becomes:On the surface, the elements of a tuple do change, but in fact it is not a tuple element, but a list element. The list that the tuple ini
tighter support for industry standards than any earlier browser version. As a result, sites designed for older browsers may not appear as expected. To help mitigate any problems, Internet Explorer 8 introduces the concept of document compatibility, which allows you to specify the version of Internet Explorer that your site supports. Document compatibility adds new patterns to Internet Explorer 8, which tells the browser how to interpret and render the site. If your site does not display correct
Fast implementation of meta-conversion in Excel tables to a million-display method
Left table is the source table, and the right table shows the table. There is a box next to the right table (million).
Click on the box, the box will draw a tick. The right table will now be converted to a million-dollar display.
This conversion is convenient. The following article to take you to make.
Production steps:
1, development tools
1.Tuple type: In parentheses, separated by commas between different elements. The size of the tuple and the elements therein cannot be modified after initialization , and the tuple is faster than the modifiable list operation .Note: If a developer defines a constant set of values and the only thing to do with it is to read continuously, this is the advantage of a tuple. 2. Built-in functions and operations:indexes, slices, loops, lengths, including similar lists, refer to the listTP = ('Simon',"
List: Actions that can be added to the list for pruning and checkingTuples: Immutable lists, non-modifiable, denoted by ()Values = (ten, (), +, +)print (values[0])print (values[2])# Result1030Traversing tuples for inch Values Print (value)# result1020304050modifying tuple variables# Although you cannot modify values in the values tuple, you can modify the value of a variable in values # error cannot modify tuple value values[0] =[+] = (50, 40, 30, 20, 10 )print (values)# rsult(50, 40, 30
Unary operators:
Serial number
Unary operators
Description
1
i++
Add 1 to I
2
i--
Minus 1 for I
3
++i
Add 1 to I
4
-I.
Minus 1 for I
i++;/*Cases:int i=1;i++;//first assigns the value of I 1 to I, then I plus 1*/i--;/* Ibid./+ +i;/*Cases:int i=1;++i;//the i+1 first, and then assigns the value to I*/I.;/* Ditto */Binary operators
Serial number
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.