Python学习:两个split的比较


                [color="#00c600"]>>> [color="#808000"]help [color="#000000"]([color="#808000"]str[color="#00c600"].[color="#808000"]split[color="#000000"])
Help on method_descriptor:

split(...)
     S.split([sep [,maxsplit]]) -> list of strings

     Return a list of the words in the string S, using sep as the
     delimiter string.  If maxsplit is given, at most maxsplit
     splits are done. If sep is not specified or is None, any
     whitespace string is a separator.

[color="#00c600"]>>> [color="#808000"]help [color="#000000"]([color="#800000"]os[color="#00c600"].[color="#000000"]path[color="#00c600"].[color="#808000"]split[color="#000000"])
Help on function split in module ntpath:

split(p)
     Split a pathname.

     Return tuple (head, tail) where tail is everything after the final slash.
     Either part may be empty.

[color="#00c600"]>>> [color="#800000"]os[color="#00c600"].__file__.[color="#808000"]split[color="#000000"]([color="#ff00ff"]'\\'[color="#000000"])
[color="#000000"][[color="#ff00ff"]'E:'[color="#000000"], [color="#ff00ff"]'Python'[color="#000000"], [color="#ff00ff"]'Python25'[color="#000000"], [color="#ff00ff"]'lib'[color="#000000"], [color="#ff00ff"]'os.pyc'[color="#000000"]]
[color="#00c600"]>>> [color="#800000"]os[color="#00c600"].[color="#000000"]path[color="#00c600"].[color="#808000"]split[color="#000000"]([color="#800000"]os[color="#00c600"].__file__[color="#000000"])
[color="#000000"]([color="#ff00ff"]'E:\\Python\\Python25\\lib'[color="#000000"], [color="#ff00ff"]'os.pyc'[color="#000000"])