piano.py
import time
from pynput.keyboard import Controller
import webbrowser
keyboard = Controller()
with open('辞九门回忆') as f:
music = f.readlines()
num = 0
for m in music:
music[num] = m.strip()
num += 1
'''
1234567
890q w e r
t y u i o p a
'''
num = 0
stop = False
webbrowser.open('https://www.autopiano.cn/post/3110')
time.sleep(15)
K = False
while True:
if not K:
t = 0.6
else:
t = 1.2
if len(music) > num:
if '-' not in music[num]:
stop = False
if not stop:
keyboard.type(music[num])
if music[num] == '/':
if not K:
K = True
else:
K = False
if '-' in music[num]:
stop = True
elif len(music[num]) == 2 and '-&#