iT邦幫忙

0

[已解決]Python Tkinter 清單按照1.2.3.4.5..... .順序讀取圖片

小弟用GIF讀取他一張一張的圖片 所以必須要從第1張開始讀取
https://ithelp.ithome.com.tw/upload/images/20200428/20126577qjqQRJHnx8.jpg
目前只會用隨機選擇的函數有成功但他是隨機選擇
我想要他按到清單編號順序從0.1.2.3.4.5 我有嘗試過下列函式 sorted 和 sort 但沒有效果
https://ithelp.ithome.com.tw/upload/images/20200428/20126577KasBYp3H3n.jpg

你可以參考這篇的做法 https://ithelp.ithome.com.tw/questions/10198070
sorted([filename], key= lambda x: int(x.replace("star", "")))
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答