科技周写Python项目想从本地文档读入的时候用这段代码直接把窗口搞崩了,有人能来看看吗qwq
def fileRead():
file=open("map.txt","r");
tmp="w";
isIn=False;
isNum=True;
ret="0";
global fileCnt;
while tmp!=" " and tmp!="\n":
fileCnt+=1;
file.read(fileCnt);
if isIn==False:
ret=tmp;
isIn=True;
continue;
if (not '0'<=tmp<='9'):
isNum=False;
ret=ret+tmp;
if isNum:
ret=int(ret);
file.close();
return ret;