来自python文档:
import_stmt: "import" module ["as" name] ("," module ["as" name] )*
| "from" module "import" identifier ["as" name]
("," identifier ["as" name] )*
| "from" module "import" "*"
module: (identifier ".")* identifier
为什么我们需要为库定义别名?
答案 0 :(得分:5)
有几次。
为避免名称冲突
Out[16]:
extracted text
0 the dog eats the cat the cat eats the dog. the dog eats the cat
避免长名
from bisect import bisect
from homework import bisect as my_bisect
# TODO: test if the two functions works similarly
做模因
import tensorflow as tf