美文网首页
Python中from...import 与import...a

Python中from...import 与import...a

作者: 王大垚 | 来源:发表于2017-09-19 17:16 被阅读0次

from...import

from A import b,相当于

import A

b = A.b

此过程中有一个隐含的赋值的过程

import...as

import A as B

给予A库一个B的别称,目的是为了好记。。可以按照自己的意愿给模块起别名

相关文章

网友评论

      本文标题:Python中from...import 与import...a

      本文链接:https://www.haomeiwen.com/subject/dscgsxtx.html