基本数据类型
int a = int('123') #将字符串转为int num = 'a' b = int(num,base=16) #将num以16进制进行转换 num.bit_length() #num的二进制位数
class str(object): """ str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'. """ def capitalize(self, *args, **kwargs): # real signature unknown """ 返回字符串的大写版本。 更具体地说,使第一个字符有大小写,其余字符为小写 的情况。 """ pass def casefold(self, *args, **kwargs): # real signature unknown """ 转换字符串中所有大写字符为小写。 返回适合无实例比较的字符串版本。 """ pass def center(self, *args, **kwargs): # real signature unknown """ 返回长度宽度居中的字符串。 填充是使用指定的填充字符(默认是空格)完成的。 """ pass def count(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ """ S.count(sub[, start[, end]]) -> int 返回子字符串子字符串不重叠出现的次数 字符串(开始:结束)。可选参数开始和结束是 用切片表示法解释。 """ return 0 def encode(self, *args, **kwargs): # real signature unknown """ 使用为编码而注册的编解码器对字符串进行编码。 encoding The encoding in which to encode the string. errors The error handling scheme to use for encoding errors. The default is 'strict' meaning that encoding errors raise a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors. """ pass def endswith(self, suffix, start=None, end=None): # real signature unknown; restored from __doc__ """ S.endswith(suffix[, start[, end]]) -> bool 如果S以指定的后缀结束,则返回True,否则返回False。 有了可选的开始,在那个位置开始测试。 可选结束时,停止在那个位置比较S。 后缀也可以是字符串的一组尝试。 """ return False def expandtabs(self, *args, **kwargs): # real signature unknown """ 把字符串中的tab符号('\ t')转为空格,tab符号('\ t')默认的空格数是8。 """ pass def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ """ 在S中找到子字符串下标, 在S[start:end]中包含子结点。可选 参数开始和结束被解释为切片表示法。 失败返回1。 """ return 0 def format(self, *args, **kwargs): # known special case of str.format """ S.format(*args, **kwargs) -> str 返回格式化版本的S,使用来自args和kwargs的替换。 替换用大括号('{' '和'}'来标识。 """ pass def format_map(self, mapping): # real signature unknown; restored from __doc__ """ S.format_map(mapping) -> str 使用map的替换返回格式化的S版本。 替换用大括号('{' '和'}'来标识。 """ return "" def index(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ """ S.index(sub[, start[, end]]) -> int 返回在S中找到子字符串下标的最低索引, 在S[start:end]中包含子结点。可选 参数开始和结束被解释为切片表示法。 在没有找到子字符串时引发ValueError。 """ return 0 def isalnum(self, *args, **kwargs): # real signature unknown """ 至少有一个字符并且所有字符都是字母或数字则返回 True,否则返回 False """ pass def isalpha(self, *args, **kwargs): # real signature unknown """ 至少有一个字符并且所有字符都是字母则返回 True,否则返回 False """ pass def isascii(self, *args, **kwargs): # real signature unknown """ 如果字符串中的所有字符都是ASCII,则返回True,否则返回False。 ASCII字符的代码点在U+0000-U+007F范围内。 空字符串也是ASCII。 """ pass def isdecimal(self, *args, **kwargs): # real signature unknown """ 如果字符串是十进制字符串,则返回True,否则返回False。 如果字符串中的所有字符都是十进制和 字符串中至少有一个字符。 """ pass def isdigit(self, *args, **kwargs): # real signature unknown """ 如果字符串只包含数字则返回 True 否则返回 False。 Return True if the string is a digit string, False otherwise. A string is a digit string if all characters in the string are digits and there is at least one character in the string. """ pass def islower(self, *args, **kwargs): # real signature unknown """ 如果字符串中包含至少一个区分大小写的字符,并且所有这些(区分大小写的)字符都是小写,则返回 True,否则返回 False Return True if the string is a lowercase string, False otherwise. A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string. """ pass def isnumeric(self, *args, **kwargs): # real signature unknown """ 如果字符串中只包含数字字符,则返回 True,否则返回 False Return True if the string is a numeric string, False otherwise. A string is numeric if all characters in the string are numeric and there is at least one character in the string. """ pass def isprintable(self, *args, **kwargs): # real signature unknown """ 如果字符串是可打印的( 全部可以显示),则返回True,否则为False。 如果字符串的所有字符都被认为是可打印的,那么它就是可打印的 repr()或者它是空的。 """ pass def isspace(self, *args, **kwargs): # real signature unknown """ 如果字符串中只包含空格,则返回 True,否则返回 False. Return True if the string is a whitespace string, False otherwise. A string is whitespace if all characters in the string are whitespace and there is at least one character in the string. """ pass def istitle(self, *args, **kwargs): # real signature unknown """ 如果字符串中所有的单词拼写首字母是否为大写,且其他字母为小写则返回 True,否则返回 False. Return True if the string is a title-cased string, False otherwise. In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones. """ pass def isupper(self, *args, **kwargs): # real signature unknown """ 如果字符串中包含至少一个区分大小写的字符,并且所有这些(区分大小写的)字符都是大写,则返回 True,否则返回 False Return True if the string is an uppercase string, False otherwise. A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string. """ pass def join(self, ab=None, pq=None, rs=None): # real signature unknown; restored from __doc__ """ 返回通过指定字符连接序列中元素后生成的新字符串。 Concatenate any number of strings. The string whose method is called is inserted in between each given string. The result is returned as a new string. Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs' """ pass def ljust(self, *args, **kwargs): # real signature unknown """ 返回一个左对齐的字符串长度宽度。 填充是使用指定的填充字符(默认是空格)完成的。 """ pass def lower(self, *args, **kwargs): # real signature unknown """ 返回转换为小写的字符串的副本。 """ pass def lstrip(self, *args, **kwargs): # real signature unknown """ 将字符串的副本返回,并删除前面的空格。 如果给定字符而不是None,则删除字符中的字符。 """ pass def maketrans(self, *args, **kwargs): # real signature unknown """ 替换 Return a translation table usable for str.translate(). If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result. """ pass def partition(self, *args, **kwargs): # real signature unknown """ 使用给定的分隔符将字符串划分为三部分。 这将搜索字符串中的分隔符。如果找到分隔符, 返回包含分隔符(分隔符)之前部分的3元组 它本身,以及它后面的部分。 If the separator is not found, returns a 3-tuple containing the original string and two empty strings. """ pass def replace(self, *args, **kwargs): # real signature unknown """ Return a copy with all occurrences of substring old replaced by new. count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences. If the optional argument count is given, only the first count occurrences are replaced. """ pass def rfind(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ """ S.rfind(sub[, start[, end]]) -> int Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. """ return 0 def rindex(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ """ S.rindex(sub[, start[, end]]) -> int Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found. """ return 0 def rjust(self, *args, **kwargs): # real signature unknown """ Return a right-justified string of length width. Padding is done using the specified fill character (default is a space). """ pass def rpartition(self, *args, **kwargs): # real signature unknown """ 使用给定的分隔符将字符串分成三个部分. 这将搜索字符串中的分隔符,从末尾开始。如果 找到分隔符后,返回一个包含该部分的3元组 分隔符,分隔符本身,以及后面的部分。 If the separator is not found, returns a 3-tuple containing two empty strings and the original string. """ pass def rsplit(self, *args, **kwargs): # real signature unknown """ 返回字符串中的单词列表,使用sep作为分隔符字符串。 sep The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result. maxsplit Maximum number of splits to do. -1 (the default value) means no limit. Splits are done starting at the end of the string and working to the front. """ pass def rstrip(self, *args, **kwargs): # real signature unknown """ 返回字符串的一个拷贝,并删除拖尾空格。 如果给定字符而不是None,则删除字符中的字符。 """ pass def split(self, *args, **kwargs): # real signature unknown """ Return a list of the words in the string, using sep as the delimiter string. sep The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result. maxsplit Maximum number of splits to do. -1 (the default value) means no limit. """ pass def splitlines(self, *args, **kwargs): # real signature unknown """ 返回字符串中的行列表,在行边界处进行破坏。 Line breaks are not included in the resulting list unless keepends is given and true. """ pass def startswith(self, prefix, start=None, end=None): # real signature unknown; restored from __doc__ """ S.startswith(prefix[, start[, end]]) -> bool 如果S以指定的前缀开始,则返回True,否则返回False。 有了可选的开始,在那个位置开始测试。 可选结束时,停止在那个位置比较S。 前缀也可以是一组要尝试的字符串。 """ return False def strip(self, *args, **kwargs): # real signature unknown """ 返回带前导和后导空格的字符串副本。 如果给定字符而不是None,则删除字符中的字符。 """ pass def swapcase(self, *args, **kwargs): # real signature unknown """ 将大写字符转换为小写字符,将小写字符转换为大写字符。""" pass def title(self, *args, **kwargs): # real signature unknown """ 返回字符串的一个版本,其中每个单词都有标题。 更具体地说,单词以大写字母开头,其余的都是 所述字符有小写字母。 """ pass def translate(self, *args, **kwargs): # real signature unknown """ 使用给定的转换表将每个字符放在字符串中。 table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None. The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted. """ pass def upper(self, *args, **kwargs): # real signature unknown """ 返回转换为大写的字符串的副本。 """ pass def zfill(self, *args, **kwargs): # real signature unknown """ Pad a numeric string with zeros on the left, to fill a field of the given width. The string is never truncated. """ pass def __add__(self, *args, **kwargs): # real signature unknown """ Return self+value. """ pass def __contains__(self, *args, **kwargs): # real signature unknown """ Return key in self. """ pass def __eq__(self, *args, **kwargs): # real signature unknown """ Return self==value. """ pass def __format__(self, *args, **kwargs): # real signature unknown """ Return a formatted version of the string as described by format_spec. """ pass def __getattribute__(self, *args, **kwargs): # real signature unknown """ Return getattr(self, name). """ pass def __getitem__(self, *args, **kwargs): # real signature unknown """ Return self[key]. """ pass def __getnewargs__(self, *args, **kwargs): # real signature unknown pass def __ge__(self, *args, **kwargs): # real signature unknown """ Return self>=value. """ pass def __gt__(self, *args, **kwargs): # real signature unknown """ Return self>value. """ pass def __hash__(self, *args, **kwargs): # real signature unknown """ Return hash(self). """ pass def __init__(self, value='', encoding=None, errors='strict'): # known special case of str.__init__ """ str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'. # (copied from class doc) """ pass def __iter__(self, *args, **kwargs): # real signature unknown """ Implement iter(self). """ pass def __len__(self, *args, **kwargs): # real signature unknown """ Return len(self). """ pass def __le__(self, *args, **kwargs): # real signature unknown """ Return self<=value. """ pass def __lt__(self, *args, **kwargs): # real signature unknown """ Return self<value. """ pass def __mod__(self, *args, **kwargs): # real signature unknown """ Return self%value. """ pass def __mul__(self, *args, **kwargs): # real signature unknown """ Return self*value. """ pass @staticmethod # known case of __new__ def __new__(*args, **kwargs): # real signature unknown """ Create and return a new object. See help(type) for accurate signature. """ pass def __ne__(self, *args, **kwargs): # real signature unknown """ Return self!=value. """ pass def __repr__(self, *args, **kwargs): # real signature unknown """ Return repr(self). """ pass def __rmod__(self, *args, **kwargs): # real signature unknown """ Return value%self. """ pass def __rmul__(self, *args, **kwargs): # real signature unknown """ Return value*self. """ pass def __sizeof__(self, *args, **kwargs): # real signature unknown """ Return the size of the string in memory, in bytes. """ pass def __str__(self, *args, **kwargs): # real signature unknown """ Return str(self). """ pass
posted on 2018-08-01 14:10 printHelloWord 阅读(41) 评论(0) 收藏 举报
浙公网安备 33010602011771号