Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- #import datetime
- import os
- import platform
- # find out if we're running on Windows, Mac or Linux
- if platform.system()=="Windows":clsMode="cls"
- else:clsMode="clear" #Linux/Mac
- def cls():
- _=os.system(clsMode)
- def txtCentre(txt):
- rows,columns=os.popen('stty size','r').read().split()
- pos=int(columns)/2-(len(txt)/2)
- print(" "*int(pos),txt)
- def terminate(txt):
- print(txt)
- os._exit(os.EX_CONFIG)
- def init():
- rows,columns=os.popen('stty size','r').read().split()
- if int(rows)<20:terminate("ERROR: Console needs to be at least 20 lines high!")
- def menu():
- cls()
- txtCentre("QuizMaster v1.oo (7th Nov 2022) by Zeb")
- print("")
- init()
- menu()
- #x=datetime.datetime.now()
- #print(x.strftime("%d-%b-%Y %H:%M:%S (Week %W)"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement