Python TQC考題804 大寫轉換 .title() .upper() .lower() by 儲蓄保險王 · 2022-05-02 #Python TQC考題804 大寫轉換 s=input() print(s.upper()) print(s.title()) #三種都做 相關文章Python 遞迴教學:從巢狀結構抓取所有標題Python用 pathlib.Path 優雅處理檔案與路徑:從 os 過渡的實用指南 ; from pathlib import Path ; p = Path("data") / "images" / "cat.jpg"Python DOCX 圖片瘦身實戰 import zipfile; with zipfile.ZipFile(zpath,'r') as zfPython: pandas.DataFrame() 在不同資料類型(array/dict)下的 columns 參數用法 #賦值 #選擇Python XML 的生死輪迴:深入理解 lxml.etree.fromstring(xml_bytes) #Bytes → Element Object 與 lxml.etree.tostring(Element, encoding= "utf-8") #Element Object → Bytes ; 處理 XML 時,盡量全程保持 Bytes (二進位) 狀態。Python: 如何利用dict.pop() 對字典重新排序? dict.pop() #刪除key,回傳valuePython爬蟲:BeautifulSoup的.find_all() 與select() ; from bs4 import BeautifulSoup ; .string .text .get_text() 獲取文字內容Python如何串接OpenAI /Claude /Gemini API自動將大量維修紀錄JSON轉自然語言描述(並避免中斷資料遺失)response = client.chat.completions.create() ; reply = response.choices[0].message.contentPython: 如何使用graphviz套件繪製流程圖? from graphviz import Digraph ; dot = Digraph() ; dot.attr(rankdir='TB', size='10,15') #"TB": Top to Bottom, 從上而下的佈局
0 Python:如何將folder_path & file_name合併為file_path? fpath = os.path.join (folder , fname) #不需要[ ]包覆folder,fname; fpath1 = “\\”.join( [folder , fname] ) #需要[ ] 包覆folder,fname ; 反過來講,file_path如何拆分為folder_path & file_name? os.path.dirname() ; os.path.basename() ; file_name如何拆分為主檔名與副檔名os.path.splitext() #split(分裂) ext 2023-07-17
0 Python:如何用pandas.concat() 合併兩個DataFrame並重置index? pd.concat([df1, df2]) .reset_index(drop=True) ; pd.concat([df1, df2], ignore_index=True) 2023-03-11
0 Python: 如何調整輸出的xlsx檔,套用最適col width / row height? cell.alignment = Alignment( wrap_text = True) 2024-11-28
近期留言