各位大佬看看这是什么问题?
python3吧
全部回复
仅看楼主
level 2
代码如下,这是我的一个未完成的记分板:
import tkinter,os,glob
from tkinter import messagebox,simpledialogwindow = tkinter.Tk()
window.title('计分板')
if os.path.isdir('txtfiles'):
os.unlink('txtfiles')
os.mkdir('txtfiles')
scoretxt = open('txtfiles/scoretxt.txt','w')
scoretxt.write('3453465公园56和{}')
scoretxt.close
scoretxt2 = open('txtfiles/scoretxt.txt','w+')
st1 = scoretxt2.read()
scoretxt2.close
path = glob.glob('txtfiles')
def start():
num = 0
messagebox.showinfo('系统消息.','欢迎来到 开局向导.')
renshu = simpledialog.askinteger('有几个人参加游戏?','-------------------------------')
for u in range(1,renshu+1):
messagebox.showinfo('系统消息.','请先排名,再听:选手'+ str(u) +'分配名字为:' + str(u))
while True:
for q in range(1,renshu + 1):
plusnum = simpledialog.askinteger('System.','給' + str(q) + '加几分?')
if plusnum == None:
break
else:
num = num + plusnum
dic1 = {}
dic1[q] = num
for f in path:
os.remove(f)
scoretxt2 = open('txtfiles/scoretxt_' + str(q) + 'temp.txt','w')
scoretxt2.write(str(dic1))
scoretxt2.close
if plusnum == None:
break
btnstart = tkinter.Button(text = '开局.',command = start)
btnstart.place(x = 0,y = 0,width = 200,height = 60)
window.mainloop()
2021年01月29日 06点01分 1
level 5
对Python感兴趣的朋友可以加q交流群哦:821189983,回复:g 群内每天会更新Python资料,还有大神专业指导哦!
2021年01月30日 01点01分 2
1