I have made a simple racing game in python with pygame, easygui, and shelve. I finished the game and it worked great both from idle and from my .desktop file. After that i decided to attempt to add a highscore system. The system works great from idle, but from the .desktop file i get an error "fatal python error: (pygame parachute) segmentation fault." I would really like to leave the highscore system in the game so any help would be appreciated.`
if hero.colliderect(finishline):
starttimer=0
running=0
d=shelve.open('highscores.txt')
highscore=d['highscore']
if time<highscore:
d=shelve.open('highscores.txt')
d['highscore']=time
player=easygui.enterbox(msg=("Congratulations you have set the new highscore of "+str(time)+ " please enter your name"))
d['player']=player
d.close
if time>highscore:
d=shelve.open('highscores.txt')
player=d['player']
highscore=d['highscore']
d.close
easygui.msgbox(msg=("Congratulations you have finished with a time of "+str(time)+" The highscore is "+str(highscore)+ "set by "+player))
`