CD2021 40823139

  • Home
    • Site Map
    • reveal
    • blog
  • Stage-1
    • 最終結果
    • 問題檢討
      • 最佳化設計
      • 模擬的碰撞問題
      • 機構模型過於理想
      • 時間裕度
    • week2
    • week3
    • week4
  • Stage-2
    • week6
    • week7
    • week8
    • week9
  • Stage-3
    • 模型簡化
    • W16 exam
    • W13~W14
      • 翻譯
      • Pick and Place
    • task1
      • 獲得正確順序(沒嵌入網站)
      • 嵌入網站
    • task2
    • task3
  • 機器人學
    • 正向運動學
    • 逆向運動學
  • Program
    • 基礎Python
      • package-example
      • geometry
      • funtion-args
      • funtion-basic
      • loop-basic
      • loop-control
      • module
      • number-string
      • set-dictionary
      • start
      • datatype
      • condition
      • list-tuple
  • About
  • 學期總結
  • CMSiMDE
    • 基本操作
      • 編輯網頁內容
      • 上傳與引用檔案
      • 上傳與引用圖片
      • 嵌入程式碼
      • 嵌入影片檔
      • 檢視 STL
    • Gitlab 同步
    • Heroku 部署
    • Fossil SCM
  • 建立網頁
  • 網站錯誤
    • 標題選擇
    • 靜態網頁 404
    • 動態網站錯誤
    • 出現ValueError
  • 延伸開發
loop-control << Previous Next >> number-string

module

#用內建模組取得資訊
import sys
print(sys.platform)#取得作業系統資訊
print(sys.maxsize)#取得最大整數值(不限在python裡面)



import sys as s
print(s.platform)
print(s.maxsize)
#可將模組名稱as為另一名稱做呼叫

import sys
sys.path.append("modules")
print("sys.path")
#增加模組路經,使系統能搜尋到(要在呼叫前就新增才行)
#路徑可用相對路徑或絕對路徑

import sys
print(sys.path)
#印出系統路徑(注意系統路徑!避免檔案找不到)
import geometry 
result=geometry.dis(5,10,5,10)
print(result)
#引用gemetry模組,計算兩點距離
result=geometry.slope(5,10,5,10)
print(result)
#引用gemetry模組,計算兩點斜率


loop-control << Previous Next >> number-string

Copyright © All rights reserved | This template is made with by Colorlib