基礎Python <<
Previous Next >> geometry
package-example
config.json
{"name": "new name", "version": "10.0.0"}
main
import geometry.line #import時,要載入完整的名稱(封包.module)
result = geometry.line.dis(1,5,1,5)
print(result)
#載入封包geometry中的line模組,進行兩點距離運算
import geometry.point
result = geometry.point.slope(1,5,1,5)
print(result)
#載入封包geometry中的slope模組,進行斜率運算
import geometry.point as p
result = p.slope(1,5,1,5) #記得as成另一名稱,後面程式呼叫要記得改
print(result)
基礎Python <<
Previous Next >> geometry