Python 3.7 Fuctions Tables
all build in Fuctions
bool
bool
abs
obj
all
bool
any
bool
bin
str
float
flo
chr
str
callable
bool
str
str
basestring
none
filter
iter
classmethod
none
bytearray
list
cmp
int
compile
obj
complex
obj
delattr
none
dict
iter
enumerate
obj
dir
iter
divmod
iter
eval
obj
hash
obj
file
none
excefile
none
format
none
getattr
obj
frozenset
obj
globals
iter
hasattr
bool
help
func
input
none
hex
exp
id
obj
int
int
isinstance
obj
issubclass
obj
iter
obj
len
int
list
iter
locals
iter
long
obj
map
iter
max
obj
memoryview
obj
next
obj
min
obj
object
obj
open
obj
oct
obj
ord
obj
pow
obj
print
obj
property
obj
range
iter
repr
obj
set
set
round
obj
setattr
none
reversed
iter
slice
obj
staticmethod
none
__import__
none
sum
obj
super
obj
tuple
iter
sorted
iter
type
ty
vars
iter
zip
iter
abs()
Python
import os def main(): run() return a
abs(x)
返回参数的绝对值。参数可以是整数或浮点数。如果参数是复数,则返回其大小
all(iterable)
返回 True 或 False。可迭代对象的所有元素都为真(不存在 None 或者 False)或者迭代对象是空的,返回True, 否则返回False
any(iterable)
与all() 相反,如果可迭代对象中的任何一个元素为True,返回True, 如果可迭代对象为空,则返回False
ascii(object)
ascii() 函数类似 repr() 函数, 返回一个表示对象的字符串
bin(x)
将整数转换为前缀为“0b”的二进制字符串(只接受 int 对象)
bool(x)
返回True或者False。 用于真值测试
breakpoint(*arg, **kws)
比旧版本pdb.set_trace() 方便的函数断点测试(旧版还需导入pdb),而且breakpoint()是可定制性的。
pdb断点测试
bytearray(source [, encoding [, errors]])
返回一个新的字节数组,如果没有传入任何参数,将创建大小为0的字节数组
bytes(source [, encoding [, errors]])
返回一个新的“bytes”对象,该对象是该范围内不可变的整数序列
callable(object)
类对象可调用时返回True, 否则返回False,如果返回true,则调用仍然可能失败,但如果为false,则调用对象将永远不会成功
chr(i)
用一个范围在0~255的整数作参数,返回一个对应的字符
classmethod()
将方法转换为类方法, 类方法接收类作为隐式的第一个参数, 该@classmethod形式是一个函数装饰, 类方法的第一个参数为cls,即类本身,如果在 classmethod 中访问类的方法或者属性, 因为持有cls 参数,可以直接使用cls 参数来访问 类的方法、属性。形如 cls.arribute, cls.method
compile(s,f,m,fl = 0,do = False,o = -1 )
将源代码编译为代码或AST对象。代码对象可以由exec()或执行eval()
第一个参数
source
字符串或者AST(abstract syntax trees)对象
第二个参数
filename
代码文件名称,如果不是从文件读取代码则传递一些可辨认的值
第三个参数
model
指定编译代码的种类。可以指定'exec', 'eval', 'single', 在'single'或 'eval'模式下使用多行代码编译字符串时,输入必须至少由一个换行符终止。这有助于检测code模块中不完整和完整的语句
第四个参数
flags
, 第五个参数
dont_inherit
两个可选参数, 控制那些
feture statements
及影响源代码编译
第六个参数
optimize
参数optimize指定编译器的优化级别
警告
由于Python AST编译器中的堆栈深度限制,在编译为AST对象时,可能会使Python解释器崩溃并使用足够大/复杂的字符串
complex()
delattr()
dict()
dir()
divmod()
enumerate()
eval()
exec()
filter()
float()
format()
frozenset()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
int()
isinstance()
issubclass()
iter()
len()
list()
locals()
map()
max()
memoryview()
min()
next()
object()
oct()
open()
ord()
是chr()函数(对于8位的ASCII字符串)的配对函数,它以一个字符(长度为1的字符串)作为参数,返回对应的ASCII数值
pow()
print()
property()
range()
repr()
reversed()
round()
set()
setattr()
slice()
sorted()
staticmethod()
str()
sum()
super()
tuple()
type()
vars()
zip()
__import__()
Social Media
Serious Work
Personal Development
Fun Stuff
→ Across the table: Importance
↓ Down the table: Time Spent