나는 숫자의 형태로 이름과 특정 입력을 받아서 점수를 얻는 프로그램을 만들고 있는데이 점수를 텍스트 파일에 저장하고 싶습니다. 그것을 여러 번 할 수 있지만이 파일에 쓸 때 마지막으로 통계를 덮어 다음은이통계 텍스트 파일 만들기 (파이썬)
을 변경하려면 어쨌든은 내가 사용 기능이이다 :
def calculate():
try:
a = float(enter1.get())
b = float(enter2.get())
c = float(enter3.get())
d = float(enter4.get())
e = float(enter5.get())
f = float(enter6.get())
result =(a+b+(c*2)+(d*2)+e-f)*2.5
n = result
w = "Score:"
label7.config(text=str(result))
myfile = open('Stats.txt','w')
x = str(enter0.get())
y =("(%s) %s" % (w, n))
myfile.write(x)
myfile.write(y)
myfile.close()
except ValueError:
label7.config(text='Enter Numbers!',fg="white")
그래서 통계를 파일에 추가 하시겠습니까? – kragniz
예! 그래서 내가 새로운 이름과 새로운 숫자를 할 때 그것은 첫번째 합계 아래에 쓰여진다. – Serial