开发者

what's the difference between two Python imports

开发者 https://www.devze.com 2023-04-06 07:50 出处:网络
Python has two ways to import something from a module: from mymodule import ClassOne, ClassTwo, ClassThree

Python has two ways to import something from a module:

from mymodule import ClassOne, ClassTwo, ClassThree

and

from mymodule import (ClassOne, ClassTwo, ClassThree)

I cannot find any note (probably开发者_如何学运维, I'm just not trying hard enough) on this in Python's documentation. I want to know the significant difference between these two ways of importing.


If you put the items to import between brackets, you can use more than one line for everything you want to import, without escaping newlines.

0

精彩评论

暂无评论...
验证码 换一张
取 消