本文整理汇总了Python中song.Song.artist方法的典型用法代码示例。如果您正苦于以下问题:Python Song.artist方法的具体用法?Python Song.artist怎么用?Python Song.artist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类song.Song
的用法示例。
在下文中一共展示了Song.artist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_songs
# 需要导入模块: from song import Song [as 别名]
# 或者: from song.Song import artist [as 别名]
def get_songs(self):
cursor = self.db.cursor()
sql = '''\
select id, uid, title, artist, url, img_url, played_count, created_at, description, duration FROM SONGS
'''
cursor.execute(sql)
ret = []
while True:
data = cursor.fetchone()
if data:
song = Song()
song.dbid = data[0]
song.uid = data[1]
song.title = data[2]
song.artist = data[3]
song.url = data[4]
song.img_url = data[5]
song.played_count = data[6]
song.created_at = data[7]
song.description = data[8]
song.duration = data[9]
yield song
else:
break
示例2: find_songs_by_title
# 需要导入模块: from song import Song [as 别名]
# 或者: from song.Song import artist [as 别名]
def find_songs_by_title(self, title):
"노래 제목으로 곡을 찾는다."
cursor = self.db.cursor()
sql = '''\
select id, uid, title, artist, url, img_url, played_count, created_at, description, duration FROM SONGS where title like ?
'''
cursor.execute(sql, (title, ))
ret = []
for data in cursor.fetchmany(5):
if data:
song = Song()
song.dbid = data[0]
song.uid = data[1]
song.title = data[2]
song.artist = data[3]
song.url = data[4]
song.img_url = data[5]
song.played_count = data[6]
song.created_at = data[7]
song.description = data[8]
song.duration = data[9]
ret.append(song)
return ret
示例3: find_by_id
# 需要导入模块: from song import Song [as 别名]
# 或者: from song.Song import artist [as 别名]
def find_by_id(self, dbid):
"UID로 노래를 찾는다."
cursor = self.db.cursor()
sql = '''\
select id, uid, title, artist, url, img_url, played_count, created_at, description, duration FROM SONGS where id = ?
'''
cursor.execute(sql, (dbid, ))
data = cursor.fetchone()
if data:
song = Song()
song.dbid = data[0]
song.uid = data[1]
song.title = data[2]
song.artist = data[3]
song.url = data[4]
song.img_url = data[5]
song.played_count = data[6]
song.created_at = data[7]
song.description = data[8]
song.duration = data[9]
return song