0
試圖從該名單中我試圖插入我的數據庫中刪除\ u0141Python的編碼清單「列表」對象有沒有屬性「編碼」
results=[['The Squid Legion', '0', u'Banda \u0141ysego', '1', ["\nRazer's Clash of the Gods EU #12 - \nChallonge\n"]], ['Romanian eSports', '1', 'Love', '0', ["\nRazer's Clash of the Gods EU #12 - \nChallonge\n"]]]
results =[[x.encode('ascii', 'ignore') for x in l] for l in results]
我收到此錯誤:
AttributeError: 'list' object has no attribute 'encode'
您的列表至少有3個層次,但您只能迭代2個層次。 –
而你的一些字符串只有2級。 –
每個'l'的最後一個'x'是一個列表。 –