from msvcrt import getch from colorama import init init(autoreset=True) black=30 red=31 green=32 yellow=33 blue=34 pink=35 cyan=36 white=37 fullchar='█' def color(what,text=None,bg=None,bold=False,underline=False,blink=False,fanxian=False,disnone=False): clist=[] clist.append(str(text)) if text else None clist.append(str(bg+10)) if bg else None clist.append('1') if bold else None clist.append('4') if underline else None clist.append('5') if blink else None clist.append('7') if fanxian else None clist.append('8') if disnone else None return '\033['+';'.join(clist)+'m'+what+'\033[0m' def clear(): print("\x1b[2J\x1b[H",end='') clear_c="\x1b[2J\x1b[H" clear_line_c="\r\033[K" f=open('../desktop.html','r',encoding='utf8').read().split('\n') p=open('./lang_en.properties','a',encoding='utf8') n=open('../desktop.html','w',encoding='utf8') i=int(input('line> ')) while i ') if not '=' in iid: f[i]=f[i][:pos]+' data-i18n="'+iid+'"'+f[i][pos:] break txt='='.join(iid.split('=')[1:]) iid=iid.split('=')[0] f[i]=f[i][:pos]+' data-i18n="'+iid+'"'+f[i][pos:] p.write(iid+'='+txt+'\n') break elif g==b'\x1b': # ESC键,保存内容并退出 n.write('\n'.join(f)) exit()