This function is the identifier of the object that returns the objects, the identifier type is an integer, and the identifiers of all objects are unique at the same time, if the objects in different lifecycles have the same identifier. For example,
This function converts a string representation of an integer object to 16, such as a format like 0x . If the object is not an integer, a method ___index__ () should be defined to return an integer. If you want to convert the result of this function
Returns a new array object that cannot be modified by an array element. Range of values per element : 0 max. the main difference between the bytes function and the ByteArray function is that the elements of the object produced by the bytes function
This function converts a string representation of a character to an integer corresponding to a character typeface, and is suitable for UNICODE characters. For example , ord (' a ') returns an integer , andord (' \u2020 ') returns an integer 8224 .
This function opens a file and returns the file object. If the file cannot be opened, throw an exception OSError. The argument file is a string representing the file name, or an array representing the file name. The file name can be the path
In the work encountered this function, did not think of any encounter, a look surprised me, this function is very powerful. The following is a brief introduction to its usage.1. Get class variablesClass A: a = 1getattr (A, ' a ') = = 12. Get
The function ord () and Chr () is a pair of functionally opposite functions, the function ord () is used to return the Unicode code of a single character, and the function Chr () is used to return the character corresponding to the Unicode encoding.>
1. Capitalize (self)Converts the first character of a string to uppercase2. Casefold (self)Returns a string that is generated when all uppercase characters in a string are converted to lowercase3. Center (self, width, fillchar=none)Returns a string
This function is to convert a string or an integer to a floating-point number. If the parameterxis a string, the number string is used only in decimal notation, which can be preceded by a symbol to represent a positive number, or negative. If the
This function is an array that produces a series of sequences, returning an iteration. The parameter Stop is the number that terminates, and The parameter start is the starting value of the start sequence, and the parameter step is the difference
This function creates a new dictionary from an object that can be iterated. For example, a tuple consists of a list, or a Dictionary object.Examples:#dict () #以键对方式构造字典d1 = dict (one = 1, one = 2, a = 3) print (D1) #以映射函数方式来构造字典d2 = Dict ([' One ', '
Returns Trueif The object argument is an object that can be called, otherwise False. It is important to note, however, that when an object is callable, it does not mean that the object is invoked when it succeeds, but the non-callable object must
There are a number of methods related to the string handling of Python. Because I was learning python, I summed up Python's mixed functions for string and found it handy when I forgot, hoping to help people with similar needs.
Captalize ()
This function is a method that implements access to a parent class or sibling class object, which is a proxy class object that is returned in order to access the parent class or sibling class. This function is used primarily to avoid the use of the
1 descriptionThe eval () function is used to execute a string expression and return the value of the expression2 syntaxOriginaleval (expression[, globals=none[, Locals=none])Expression (sourse)-- string expression . That is, you cannot forget the
Python has a lot of built-in functions, so-called built-in functions, which are functions that are automatically loaded in Python, can be used at any time. Built-in functions, which means we don't have to import modules to use this function. Python
1 php_function (Str_pad)2 {3 /*Input Arguments*/4Zend_string *input;/*Input String*/5Zend_long pad_length;/*length to pad to how long to fill.*/6 7 /*Helper Variables*/8size_t Num_pad_chars;/*number of padding characters (total-input size)
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.