Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self):
while True:
self.display()
i = getch._Getch()
c = i()
if c == 'k':
self.updown(-1)
if c == 'j':
self.updown(1)
if c == 'q':
break
def main(filename):
settings = load_settings(filename)
if not os.path.exists(settings['title']):
os.makedirs(settings['title'])
resume = False
try:
r_file = open(path_join(settings['title'],'.dump'),'r')
print "Do you want to resume Y/n:"
while True:
r = getch._Getch()()
if r=='':
resume = True
print "Resumed"
break
if r in ('y','Y','\n'):
resume = True
print "Resumed"
break
if r in ('n','N'):
break
except IOError:
print 'No save file found'
pass
if resume:
#Resuming from file