python文件中调用其他python文件的类

test1.py中有class A
test2.py中有class B
如果你要在test2.py里用class A 需要在test2.py的开头写上 from test1 import A

类似如下效果:

 

posted @ 2019-05-08 16:17  渣滓  阅读(8400)  评论(0编辑  收藏  举报