python27期python连接数据库:
作者:互联网
import pymysql
#创建connectinon对象:
con = pymysql.connect(host = "localhost",user = "root",password = "123",db = "day32",charset = "utf8")
# 创建cursor对象:
car = con.cursor()
car.execute("select * from sanguo")
data = car.fetchall()
for i in data:
print(i)
结果: (1, '吕布', 32, '方天画戟', '群雄', '魔神降世', 1)
(2, '赵云', 46, '龙胆', '蜀国', '天翔之龙', 1)
(3, '曹操', 50, '百辟刀', '魏国', '霸道之刃', 1)
(4, '夏侯惇', 15, '也是刀', '魏国', '无极之刃', 1)
(5, '小乔', 18, '扇子', '吴国', '星华缭乱', 1)
(6, '大乔', 19, '灯笼', '吴国', '魔神降世', 1)
(7, '孙尚香', 28, '方天画戟', '群雄', '魔神降世', 1)
python听歌:
import pygame
import time
pygame.mixer.init()
pygame.mixer.music.load(f"F:\无损音乐\洛天依 - 洛天依投食歌.mp3")
pygame.mixer.music.play()
time.sleep(100)
结果: pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
标签:魔神,之刃,python,car,数据库,mixer,降世,pygame,python27 来源: https://www.cnblogs.com/zhang-da/p/11945389.html