在Python中推荐的导入样式是什么?

时间:2018-11-30 14:14:36

标签: python import

如果我想使用os.path.isfile,则有两种导入和使用的可能性:

1。

import os.path
os.path.isfile("...")

2。

from os.path import isfile
isfile("...")

推荐的导入方式/最pythonic方式是什么? 我看到1.更明确,但2.编写更容易。

感谢帮助

0 个答案:

没有答案
相关问题