Multiple aliases on one-line Python import

前端 未结 2 542
青春惊慌失措
青春惊慌失措 2020-12-19 03:35

Can I import module in Python giving it two or more aliases in one line?

With two lines this works:

from time import process_time as tic
from time im         


        
2条回答
  •  一向
    一向 (楼主)
    2020-12-19 03:56

    You can do that with

    from time import process_time as tic, process_time as toc
    

提交回复
热议问题