letters, numbers, ~! @ # $ * () =:/,;? + ' to encode.
12
encodeURI("[emailprotected]#$*()=:/,;?+‘")// [emailprotected]#$*()=:/,;?+‘
encodeURIComponent ()Hey, sometimes our URL looks like this, with another URL in the request parameter:
1
varURL ="http://www.a.com?foo=http://www.b.com?t=123s=456";
It is obviously not possible to encodeuri it directly. Because the encodeURI does not esca
%20c"//and escape will be encoded into the following, eocode the colon but no encode slash, very strange, So abandoned escape (' https://www.baidu.com/a b C ')//"https%3a//www.baidu.com/%20a%20b%20c" encodeURI ()encodeURI () is a function in Javascript that is really used to encode URLs. It looks at encoding the entire URL .encodeURI ("Http://www.cnblogs.com/season-huang/some other Thing");//"http://www.cnblogs.com/season-huang/some% 20other%20thing ";After the encoding becomes the above result,
Unicode.2) for the byte string, refer to the 2nd item in the data type5. Data type1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be converted using the. encode () (str-bytes) or. Decode () (bytes-str) methods.>>> s = B.decode ()>>> s' China '>>> B1 = S.e
The metacharacters. ^ $ * + ? {}. The match is: If a match is written to a point, if you match more than one word, write a few dots >>> a = re.findall (' b...dd ', ' BSSSDD ') >>> print (a) [' BSSSDD '] such as: > A = Re.findall (' B.. DD ', ' BSSSDD ') >>> print (a) [] explanation: Since the two points need to match the middle there are three causes that cannot match the ^ expression:>>> re.findall (' ^a. S ', ' abcsassss ') [' ABCs ']>>> re.findall
of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be converted using the. encode () (str-bytes) or. Decode () (bytes-str) methods.>>> s = B.decode ()>>> s' China '>>> B1 = S.encode ()>>> B1B ' China '3) Dict. Keys (),. Items, and. Values () methods return iterators, and functions such as the previous iterkeys () are discarded. And it's also removed.Dict.has_key (), replace it with in.6. Object-oriented1) Introduce
. Strings and byte strings1) Now the string is only one type of STR, but it is almost the same as the 2.x version of Unicode.2) for the byte string, refer to the 2nd item in the data type5. Data type1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be conver
Pep 3129 for more4. Strings and byte strings 1) Now the string is only one type of STR, but it is almost the same as the 2.x version of Unicode.2) for the byte string, refer to the 2nd item in the data type5. Data type 1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes
behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be converted using the. encode () (str-bytes) or. Decode () (bytes-str) methods.>>> s = B.decode ()>>> s' China '>>> B1 = S.encode ()>>> B1B ' China '3) Dict. Keys (),. Items, and. Values () methods return iterators, and functions such as the previous iterkeys () are discarded. A
eight-bit string, which defines a bytes literal method as follows:>>> B = B ' It '>>> type (b)The Str object and the Bytes object can be converted to each other using the. encode () (str-> bytes) or. Decode () (bytes-> str) method.>>> s = B.decode ()>>> s' I '>>> B1 = S.encode ()>>> B1B ' I '3 The Dict. Keys (),. Items, and. Values () methods return iterators, and functions such as the previous iterkeys () are discarded. And also removed from theDict.has_key (), replace it with in.
6. Object-o
version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be converted using the. encode () (str-bytes) or. Decode () (bytes-str) methods.>>> s = B.decode ()>>> s' China '>>> B1 = S.encode ()>>> B1B ' China '3) Dict. Keys (),. Items, and. Values () methods return iterators, and functions such as the previous iterkeys () are discarded. And it's also removed.Dict.has_key (), replace it with in.6. Object-oriented1) In
) Introduce abstract base classes (abstraact base classes, ABCs ). 2) The container class and iterator class are ABCs, so the types in the cellections module are much higher than those in py2.5. >>> Import collections >>> print ('/N '. join (Dir (collections) Explain quencesetsizedvaluesview _ all ____ builtins ____ Doc ____ file ____ name ___ abcoll_itemgetter_sysdefadicdictdeque In addition, the value typ
3129 for more
4. Strings and Byte strings
1) Now the string is only one type of STR, but it is almost the same as the 2.x version of Unicode.
2) for the byte string, refer to the 2nd item in the data type
5. Data type
1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long
2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:
>>> B = B ' China '
>>> type (b)
str objects and B
) introduce abstract Base Classes (Abstraact Base Classes, ABCs ).
2) the container class and iterator class are ABCs, so the types in the cellections module are much more than Py2.5.
>>> Import collections
>>> Print ('\ n'. join (dir (collections )))
Callable
Container
Hashable
ItemsView
Iterable
Iterator
KeysView
Mapping
MappingView
MutableMapping
MutableSequence
MutableSet
NamedTuple
Sequence
Set
Sized
V
only one integer--int, but it behaves like 2. The x version of Long 2) adds the bytes type, which corresponds to 2. X version of the eight-bit string, define a bytes literal in the following way: >>> b = B ' China ' >>> type (b str objects and Bytes objects can be used. Encode () (str, bytes) or. Decode () (bytes-S TR) method to convert each other. >>> s = B.decode () >>> s ' China ' >>> B1 = S.encode () >>> B1 B ' China ' 3] dict. Keys (),. Items, and. Values () methods re
1) currently, only one type of string is available, but it is almost the same as unicode in 2.x.2) For a byte string, see the 2nd entries in "data type ".
6. Data Types
1) Py3.0 removes the long type, and now there is only one integer -- int, But it acts like the long type2) The bytes type is added, which corresponds to the 8-Bit String Of The 2.x version. The following describes how to define a bytes literal:
>>> b = b>>>
3) str objects and bytes objects can be converted to each other usin
behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be converted using the. encode () (str-bytes) or. Decode () (bytes-str) methods.>>> s = B.decode ()>>> s' China '>>> B1 = S.encode ()>>> B1B ' China '3) Dict. Keys (),. Items, and. Values () methods return iterators, and functions such as the previous iterkeys () are discarded. A
. Strings and byte strings1) Now the string is only one type of STR, but it is almost the same as the 2.x version of Unicode.2) for the byte string, refer to the 2nd item in the data type5. Data type1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be conver
like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be converted using the. encode () (str-bytes) or. Decode () (bytes-str) methods.>>> s = B.decode ()>>> s' China '>>> B1 = S.encode ()>>> B1B ' China '3) Dict. Keys (),. Items, and. Values () methods return iterators, and functions such as the previous iterkeys () are discarded. And it's
. Strings and byte strings1) Now the string is only one type of STR, but it is almost the same as the 2.x version of Unicode. 2) for the byte string, refer to the 2nd item in the data type5. Data type1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be conve
. Strings and byte strings1) Now the string is only one type of STR, but it is almost the same as the 2.x version of Unicode.2) for the byte string, refer to the 2nd item in the data type5. Data type1) py3.x removed the long type and now has only one integer--int, but it behaves like 2. X version of Long2) added the bytes type, corresponding to 2. X version of the eight-bit string, define a bytes literal method as follows:>>> B = B ' China '>>> type (b)str objects and Bytes objects can be conver
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.