我可以在 Python 中导入模块,并在一行中为其指定两个或多个别名吗?
用两行就可以了:
from time import process_time as tic
from time import process_time as toc
这行不通,但我希望能够编写如下内容:
from time import process_time as tic,toc
最佳答案
你可以这样做
from time import process_time as tic, process_time as toc
关于python - 一行 Python 导入中的多个别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36481111/