[英]Import multiple modules and creating alias in one line
I want to do something like this我想做这样的事情
from folder import module_1, module_2 as m1, m2
instead of:代替:
from folder import module_1 as m1
from folder import module_2 as m2
Just for the sake of practicality.只是为了实用。 How can I do it?
我该怎么做?
Note: it's not like this question because I want to import different modules注意:这不是这个问题,因为我想导入不同的模块
Yes.是的。 The syntax was little off in the first block
第一个块中的语法很少
from folder import module_1 as m1, module_2 as m2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.