我正在尝试使用if语句进行审核,但播放列表中包含单词' http',playlist should have value 'http: //*********/****.m3u
但是如果播放列表不包含单词' http'那么我想得到值playlist '"file: ///" + playlist'
def GETPLAYLIST():
playlistset = int(addon.getSetting('playlistset')) + 1
playlist = addon.getSetting('playlist' + str(playlistset))
if 'http' in 'playlist'
else:
playlistlist = "file:///" + playlist
return playlist
答案 0 :(得分:0)
你可以改变你的状况并这样做:
def GETPLAYLIST():
playlistset = int(addon.getSetting('playlistset')) + 1
playlist = addon.getSetting('playlist' + str(playlistset))
if not 'http' in playlist:
playlist = "file:///" + playlist
return playlist