This repository has been archived by the owner on May 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_entry_screen.py
65 lines (50 loc) · 2.15 KB
/
data_entry_screen.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import tkinter as tk
from tkinter import messagebox
class DataScreen(tk.Frame):
def back(self):
self.controller.show_frame("FirstScreen")
def __init__(self, parent, controller, pages):
tk.Frame.__init__(self, parent)
self.controller = controller
self.pages = pages
self.entryLabel = tk.Label(self, text='Entry')
self.subjectCodeLabel = tk.Label(self, text='Subject Code')
self.scriptNoLabel = tk.Label(self, text='Script No.')
self.marksRegLabel = tk.Label(self, text='Marks/Reg No.')
validation = self._register(self.only_numeric_input)
self.entry = "ENTRY_VALUE"
self.subjectCode = "SUBJECT_CODE"
self.scriptNo = "SCRIPT_NO"
self.entryVal = tk.Label(self, text=self.entry)
self.subjectCodeVal = tk.Label(self, text=self.subjectCode)
self.scriptNoVal = tk.Label(self, text=self.scriptNo)
self.marksRegVal = tk.Entry(self, validate="key",
validatecommand=(validation, '%S'))
self.enterData = tk.Button(self, text="Enter Data",
command=self.finalValidation)
self.back = tk.Button(self, text="Back", command=self.back)
self.entryLabel.place(x=200, y=100)
self.subjectCodeLabel.place(x=200, y=200)
self.scriptNoLabel.place(x=200, y=300)
self.marksRegLabel.place(x=200, y=400)
self.entryVal.place(x=500, y=100)
self.subjectCodeVal.place(x=500, y=200)
self.scriptNoVal.place(x=500, y=300)
self.marksRegVal.place(x=500, y=400)
self.back.place(x=200, y=600)
self.enterData.place(x=500, y=600)
def only_numeric_input(self, e):
if e.isdigit():
return True
elif e == "":
return False
else:
return False
def finalValidation(self):
marks = self.t4.get()
if(len(marks) == 0):
messagebox.showerror("Error", "Marks Cannot be NULL")
elif (int(marks) > 100):
messagebox.showerror("Error", "Check Again")
else:
messagebox._show("Inkempo Macha", "Kottav Chance")