config = “Config”
print( config.encode() )
config_list = list(config.encode())
print(config_list)
str1=”儲蓄保險王”
print(str1.encode()) #預設值為utf-8
print(str1.encode(“utf-8”))
str1Lst = list(str1.encode())
print(str1Lst)

[67,111,110,102,105,103]
其實只是C o n f i g的ASCII碼(ord函數)
用以下語法也可以萃取出一樣的list:


與matlab結果一致:
rx_ctrl: b’\x00C\x00o\x00n\x00f\x00i\x00g’
Control:
b’\x00C\x00o\x00n\x00t\x00r\x00o\x00l’
ReControl:

b’\x00R\x00e\x00C\x00o\x00n\x00t\x00r\x00o\x00l’

![Python如何串接OpenAI /Claude /Gemini API自動將大量維修紀錄JSON轉自然語言描述(並避免中斷資料遺失)response = client.chat.completions.create() ; reply = response.choices[0].message.content Python如何串接OpenAI /Claude /Gemini API自動將大量維修紀錄JSON轉自然語言描述(並避免中斷資料遺失)response = client.chat.completions.create() ; reply = response.choices[0].message.content](https://i0.wp.com/savingking.com.tw/wp-content/uploads/2025/07/20250716084059_0_c5b368.png?quality=90&zoom=2&ssl=1&resize=350%2C233)









近期留言