基础DAY11-模块import
import hm_01_测试模块1 import hm_02_测试模块2 hm_01_测试模块1.say_hello() dog = hm_01_测试模块1.Dog() print(dog) hm_02_测试模块2.say_hello() cat = hm_02_测试模块2.Cat() print(cat) print(hm_01_测试模块1.title) print(hm_02_测试模块2.title)
import hm_01_测试模块1 as DogModule import hm_02_测试模块2 as CatModule DogModule.say_hello() dog = DogModule.Dog() print(dog) CatModule.say_hello() cat = CatModule.Cat() print(cat) print(DogModule.title) print(CatModule.title)