美文网首页
python模块

python模块

作者: 大鹏的鹏 | 来源:发表于2018-09-18 10:20 被阅读7次

1.导入其他模块.

import modea
from modea import test # 从 modea中导入test方法
import modea as moa #导入modea并且将命名空间变成moa

2.排除不需要执行的代码

def haha():
      print("ceshi")
if   __name__=="__main__":
  ...  

3.导入不同包下的模块.

image.png

需要在不同的包里面加int方法

import test.mode_b

相关文章

网友评论

      本文标题:python模块

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