def loadPiecesFile():
global movesString
global piecesString
global status
filename = filedialog.askopenfilename()
if not filename.endswith('.txt'):
messagebox.showinfo("Visualizer error", "Filetype must be a .txt")
else:
with open(filename, 'r') as infile:
piecesString = infile.read().replace('\n', '')
if piecesString is not None and movesString is not None:
status.set("Pieces: Loaded\nMoves: Loaded")
generateFrames(piecesString,movesString)
elif movesString is None:
status.set("Pieces: Loaded\nMoves: Not Loaded")
评论列表
文章目录