MCPcopy Create free account
hub / github.com/ActiveState/code / openlasttime

Method openlasttime

recipes/Python/334728_Cricket_GUI/recipe-334728.py:191–206  ·  view source on GitHub ↗

Get the state of play last time

(self)

Source from the content-addressed store, hash-verified

189 pickle_file.close()
190
191 def openlasttime(self):
192 """Get the state of play last time"""
193 try:
194 pickle_file = open("cricket1.dat", "r")
195 laststateofplay = cPickle.load(pickle_file)
196
197 except:
198 #as unable to use the file just use 0
199 laststateofplay = [0,0,0]
200 xold = laststateofplay[0]
201
202 yold = laststateofplay[1]
203
204 wold = laststateofplay[2]
205
206 return xold, yold, wold
207
208class CricketGUI(Frame):
209 """GUI to enter the info for the cricket class"""

Callers 1

usedbeforeMethod · 0.95

Calls 2

openFunction · 0.50
loadMethod · 0.45

Tested by

no test coverage detected