Python学习笔记

发布时间 2023-09-26 11:14:46作者: 人间二两风

pip安装包命令

pip install numpy -i https://pypi.douban.com/simple #安装(指定国内源来安装)
pip install --upgrade numpy #升级
pip uninstall numpy #卸载
pip list #查看
pip list -o #查看需要被升级的包
pip show -f numpy #查看某个包的信息
pip check numpy #查看兼容问题
pip download numpy -d "." #下载包但不安装

国内镜像源

清华源: https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云: http://mirrors.aliyun.com/pypi/simple/
豆瓣源: https://pypi.douban.com/simple

内置函数

- - - - - - - - -
A abs(x) aiter(async_iterable) all(iterable) anext(async_iterator, default) any(iterable) ascii(object)
B bin(x) bool(x=False) breakpoint(*args, **kws) bytearray(source, encoding, errors) bytes(source, encoding, errors)
C callable(object) chr(i) classmethod() compile() complex()
D delattr(object, name) dict(iterable, **kwarg) dir() divmod(a, b)
E enumerate(iterable, start=0) eval(expression, globals=None, locals=None) exec(object, globals=None, locals=None, /, *, closure=None)
F filter(function, iterable) float(x=0.0) format(value, format_spec='') frozenset(iterable=set())
G getattr(object, name, default) globals()
H hasattr(object, name) hash(object) help(request) hex(x)
I id(object) input(prompt) int(x, base=10) isinstance(object, classinfo) issubclass(class, classinfo) iter(object, sentinel)
L len(s) list(iterable) locals()
M map(function, iterable, *iterables) max(iterable, *[, key, default]) min(iterable, *[, key, default]) memoryview(object)
N next(iterator, default)
O object() oct(x) open(file, ...) ord(c)
P pow(base, exp, mod=None) print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) property(fget=None, fset=None, fdel=None, doc=None)
R range(start, stop, step=1) repr(object) reversed(seq) round(number, ndigits=None)
S set(iterable) setattr(object, name, value) slice(start, stop, step=None) sorted(iterable, /, *, key=None, reverse=False) staticmethod() str(object=b'', encoding='utf-8', errors='strict') sum(iterable, start=0) super(type, object_or_type=None)
T tuple(iterable) type(object)
V vars(object)
Z zip(*iterables, strict=False)
__import__()