Add files via upload

This commit is contained in:
adrienmalin 2019-02-08 20:13:06 +01:00 committed by GitHub
parent f26b047748
commit bce4a5cf26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ except ImportError:
import random
import sched
import time
import os
# You can change controls here.
@ -28,7 +29,7 @@ CONTROLS = {
"QUIT": "q"
}
FILE = ".terminis"
FILE = os.path.expanduser(os.path.join('~', ".terminis"))
class Rotation:
@ -503,8 +504,11 @@ class Stats(Window):
self.refresh()
def save(self):
with open(FILE, mode='w') as f:
f.write(str(self.high_score))
try:
with open(FILE, mode='w') as f:
f.write(str(self.high_score))
except:
pass
class Controls(Window):
@ -683,4 +687,3 @@ def main():
if __name__ == "__main__":
main()