python字符串列表轉列表

在linux環境輸出信息想到到windows環境拿到參數,但迫於被轉換成unicode編碼因此想要轉回utf8 後來網上查了一下可使用eval()函數 str_1 = ‘[1,2,3,4,5,6]’ list_1 = eval(str_1) list_1 [1, 2, 3, 4, 5, 6] type(list_1) linux
相關文章
相關標籤/搜索