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’


![Excel TQC考題202: 快樂小學學生名冊,自訂格式:0″公斤”;[紅色]”減”0″公斤”;[藍色]”完美身材” Excel TQC考題202: 快樂小學學生名冊,自訂格式:0″公斤”;[紅色]”減”0″公斤”;[藍色]”完美身材”](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2022/04/20220410142405_70.png?quality=90&zoom=2&ssl=1&resize=350%2C233)




![Python 表達式中的魔法:用海象運算子讓斷詞程式碼更乾淨 [w_clean for w in words if (w_clean:=w.lower().strip()) and w_clean not in STOPWORDS] Python 表達式中的魔法:用海象運算子讓斷詞程式碼更乾淨 [w_clean for w in words if (w_clean:=w.lower().strip()) and w_clean not in STOPWORDS]](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2026/02/20260210083748_0_a7d9bf.png?quality=90&zoom=2&ssl=1&resize=350%2C233)

![Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str] Python常用的模組內建常數; __name__ ; __file__ ; __doc__ ; __all__ ;__dict__; vars()->Dict[str,str] ; dir()->List[str]](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221112184006_50.png?quality=90&zoom=2&ssl=1&resize=350%2C233)

近期留言