# -*- coding: utf-8 -*- # ============================================================================= # self-defined module1 >> has been moved to myPackge.package1 # ============================================================================= ''' import myPackage.package1.module1 as m1 radius = 10 print(f"半徑為{radius}的圓,面積為{m1.CircleArea(radius)}") #''' # ============================================================================= # self-defined module2 >> has been moved to myPackge.package1 # ============================================================================= """ import myPackage.package1.module2 as m2 a = 10 b = 20 p3 = m2.polygon(3, a, b) print(p3) #""" # ============================================================================= # The modules have been moved to myPackage >> slightly different then the book # ============================================================================= """ from myPackage.package1 import module1 as m1, module2 as m2 radius = 10 print(m1.CircleArea(radius)) poly = m2.polygon(0, radius) print(poly) #""" # ============================================================================= # The modules have been moved to myPackage >> slightly different then the book # ============================================================================= ''' import myPackage.package1.module1 as m1 import myPackage.package1.module2 as m2 radius = 10 print(m1.CircleArea(radius)) poly = m2.polygon(0, radius) print(poly) #''' # ============================================================================= # The modules have been moved to myPackage >> slightly different then the book # ============================================================================= """ from myPackage.package1.module2 import * radius = 100 poly = polygon(0, radius) print(poly) #""" # ============================================================================= # Now it is correct. # ============================================================================= """ import myPackage.package2.module3 as m3 m3.fun3_1() #""" # ============================================================================= # from myPackage.package1 import module2 as m2 # ============================================================================= ''' from myPackage.package1 import module2 as m2 poly = m2.polygon(0, 30) print(poly) #''' # ============================================================================= # from myPackage.package2 import module3 as m3 # ============================================================================= ''' from myPackage.package2 import module3 as m3 s = m3.square(4, 10, 20) print(s) #'''