Python学习笔记七

import module与from module import funtion区别:

import module导入模块后你需要使用module.function()来调用一个函数,而from module import function导入一个function后你可以直接使用它。

请在你经常要使用这个function或者你确认你的代码中不会与导入的function冲突时使用from module import function,不然请使用import module。

This entry was posted in Python, 编程相关 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>