• 保障型
  • 各家保險公司1
    • 中國人壽
    • 新光
    • 富邦
    • 遠雄
    • 全球
    • 台灣人壽
    • 元大人壽
  • 各家保險公司2
    • 台銀人壽
    • 宏泰
    • 南山&朝陽
    • 國泰
    • 香港保單
    • 第一金人壽
    • 安聯
  • 投資
  • 理財與保險觀念
  • 信用卡
  • 保險局仇視短年期儲蓄險
  • 利率&利差
  • 專家?專門害人家?
  • 舊保單轉換
  • 攝影或3C
  • 新聞
  • 旅遊訂房,購物
  • 廠商廣告
  • 清單
  • 男女交友
  • 笑話
  • 電影
  • 未分類
All Rights ReservedView Non-AMP Version
儲蓄保險王
  • 攝影或3C

Python 入門教學:用 Path.stat() 與 os.stat() 讀懂檔案資訊; from pathlib import Path ; type(p).__name__ #’WindowsPath’; p.stat().st_size == os.stat(p).st_size == os.path.getsize(p)

1 個月 ago

說明 重點放在 .stat(),所有範例...

  • 攝影或3C

Python × lxml.etree:從 Word OOXML 讀、查、改、寫的實戰筆記; from lxml import etree ; parser = etree.XMLParser() ; root = etree.fromstring(xml_str.encode(“utf-8″), parser=parser) #(根節點); print(etree.tostring(root, encoding=”unicode”, pretty_print=True)) #encoding=”unicode”輸出str ; “utf-8″輸出bytes,漂亮顯示

1 個月 ago

sample.docx 內容(1021 ...

  • 攝影或3C

Python正則替換:全面掌握 re.sub 與 re.subn 的差異與實戰 #substitute(替換); . 預設匹配「除\n以外的任意單一字元」; pattern = re.compile(r'<w:p[^>]*>.*?底下插入一個圖檔.*?</w:p>’, flags = re.DOTALL) ; new_xml, n = pattern.subn(”, xml, count=1)

1 個月 ago

為什麼要關心 sub 和 subn?在處...

  • 攝影或3C

Python zipfile 全攻略:實作讀寫、解壓、重建,以及 write/writestr 的正確用法; with zipfile.ZipFile(zip_path, mode=”r”) as z: print(z.namelist()) ; z.infolist()

1 個月 ago

sample.zip將副檔名由docx改...

  • 攝影或3C

Python DOCX 圖片瘦身實戰 import zipfile; with zipfile.ZipFile(zpath,’r’) as zf

1 個月 ago

sample.docx內容僅有一小段文字...

  • 攝影或3C

python 樹狀標題父鏈追溯教學:用 _collect_parent_chain 取得階層路徑

1 個月 ago

為什麼需要父鏈 (Parent Chai...

  • 攝影或3C

Python pandas iterrows:為什麼你改 row 沒有效果?正確更新 DataFrame 的方法

1 個月 ago

摘要 iterrows 產生的是每列的 ...

  • 攝影或3C

python-docx 實務攻略: 在指定標題段落後自動插入圖片、並讓圖片不進目錄 ; 在標題段落之後插入新段落→新增 run→放入圖片,並設定 新段落.style 為 Normal 樣式避免納入目錄

2 個月 ago

摘要 目標:用 Python 在 Wor...

  • 攝影或3C

Python物件導向: 類別class裡什麼時候該用 self?什麼放成類別等級變數?區域變數, 實例屬性, 類別屬性

2 個月 ago

一、先認識三種「變數範圍」 區域變數(l...

  • 攝影或3C

Python Logging 完全指南:從基礎到實戰應用; import logging ; logging.basicConfig(level=logging.INFO, handlers=[ logging.StreamHandler(), logging.FileHandler(‘app.log’, mode=’a’, encoding=’utf-8′)] ) ; inspect.currentframe().f_code.co_name #動態取得funcName

2 個月 ago

目錄 什麼是 Logging? 為什麼需...

Show more Posts
Show previous Posts
All Rights ReservedView Non-AMP Version