Commit 03c89584 by BellCodeEditor

auto save

parent 6f3561ad
Showing with 60 additions and 31 deletions
......@@ -9,41 +9,41 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo
#pygame.mixer.music.load('歌曲4.ogg')
volume = 0.2
pygame.mixer.music.set_volume(volume)
start = stop_img
click = 0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
# volume = 0.2
# pygame.mixer.music.set_volume(volume)
# start = stop_img
# click = 0
# while True:
# for event in pygame.event.get():
# if event.type == locals.QUIT:
# exit()
# if event.type == locals.KEYDOWN:
# if event.key == locals.K_UP:
# volume += 0.1
# if volume < 0 or volume==0:
# volume = 0
# pygame.mixer.music.set_volume(volume)
# if event.key == locals.K_DOWN:
# volume -= 0.1
# if volume < 0 or volume==0:
# volume = 0
# pygame.mixer.music.set_volume(volume)
# if event.type == locals.MOUSEBUTTONDOWN:
# click += 1
# if click%2 == 0:
# pygame.mixer.music.unpause()
# start = stop_img
# else:
# pygame.mixer.music.pause()
# start = play_img
# if volume <=0:
# volume = 0
# if pygame.mixer.music.get_busy() == False:
# pygame.mixer.music.play()
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_UP:
volume += 0.1
if volume < 0 or volume==0:
volume = 0
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0 or volume==0:
volume = 0
pygame.mixer.music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN:
click += 1
if click%2 == 0:
pygame.mixer.music.unpause()
start = stop_img
else:
pygame.mixer.music.pause()
start = play_img
if volume <=0:
volume = 0
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图
......
import random
import random
zm=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',]
while True:
mm=''
try:
lx=int(input('请输入密码形式:(1是纯数字,2是纯字母,3是都有)'))
if lx!=1 and lx!=2 and lx!=3:
print('请输入1到3!')
continue
cd=int(input('请输入密码长度:'))
except:
print('请输入整数!')
else:
if lx==1:
for i in range(cd):
s=random.choice(zm[:10])
mm+=s
elif lx==2:
for i in range(cd):
s=random.choice(zm[10:])
mm+=s
else:
for i in range(cd):
s=random.choice(zm)
mm+=s
print('密码是'+mm)
print('='*80)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment