-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
40 lines (30 loc) · 1.15 KB
/
Main.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
import tkinter
from tkinter import ttk
from tkinter import messagebox
def enter_data()
accepted = accept_var.get()
if accepted == "Accepted":
# user info
firstname = first_name_entry.get()
lastname = last_name_entry.get()
if firstname and lastname:
title = title_combobox.get()
age = age_spinbox.get()
nationality = nationality_combox.get()
# Course info
registration_status = reg_status_var.get()
numcourses = numcourses_spinbox.get()
numsemesters = numsemesters_spinbox.get()
print("First name: ", firstname, "Last name: ", lastname)
print("Title: ", title, "Age: ", age, "Nationality: ", nationality)
print("# Courses: ", numcourses, "# Semesters: ", numsemesters)
print("Registration status", registration_status)
print("---------------------------------")
else:
tkinter.messagebox.showwarning(
title="Error", message="First name and last name are required.")
else:
tkinter.messagebox.showwarning(
title="Error", message="You have not accepted the terms.")
window = tkinter.Tk()
window.title("Data Entry Form")