-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
45 lines (32 loc) · 1004 Bytes
/
main.py
File metadata and controls
45 lines (32 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
import sys
import traceback
def start():
import kivy
kivy.require('1.7.0')
from kivy.config import Config
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')
Config.set('kivy', 'exit_on_escape', '0')
from kivy.app import App
from sms import root
class StudentManagementSystemApp(App):
title = 'Student Management System'
icon = 'skylight.png'
def build(self):
return root
StudentManagementSystemApp().run()
try:
prev_log = open(os.path.join(os.path.dirname(__file__), 'logs.txt')).read()
except FileNotFoundError:
prev_log = ''
try:
fd = open(os.path.join(os.path.dirname(__file__), 'logs.txt'), 'r+', buffering=1)
except FileNotFoundError:
fd = open(os.path.join(os.path.dirname(__file__), 'logs.txt'), 'w', buffering=1)
if __name__ == '__main__':
with fd:
sys.stderr = fd
try:
start()
except Exception:
traceback.print_exc(file=fd)