Import os

Def gecount():
Conuntfile=open('data. dat','a+')#以读写方式打开文件
conuttext=countfile. read()#读取文件内容
try:
count=int(count text)+1
catch:
count=1
return count