Phthon笔记:import 和 import from 的区别
Phthon:import 和 import from
简单讲:
【 import Test_1 】只是导入了 Test_1.py 这个模块 ,并没有导入模块内的函数,要使用这个模块内的函数 (例如 hello 函数 ),只能用 Test_1.hello(###) 的方法;
【 from Test_1 import hello 】从 Test_1 模块导入 hello 函数 ,要使用这个函数,只需要 hello(###) 就行了, 不需要 Test_1.hello(###)。
Python中,im
原创
2021-09-28 16:11:43 ·
180 阅读 ·
0 评论