This application is a simple GUI-based data entry form created using Python's Tkinter library. It collects user information, including personal details and course information, and stores the data in an SQLite database.
- Collects user's first name, last name, title, age, and nationality.
- Allows the user to indicate their registration status.
- Collects information about the number of courses and semesters.
- Ensures that the user accepts terms and conditions before submission.
- Stores the collected data in an SQLite database.
- Python 3.x
- Tkinter (usually included with Python)
- SQLite (usually included with Python)
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Run the script:
python data_entry_form.py
-
Fill out the form:
- Enter your first name and last name.
- Select your title from the dropdown.
- Enter your age.
- Select your nationality from the dropdown.
- Choose your registration status.
- Enter the number of courses you are taking.
- Enter the number of semesters you are enrolled for.
- Check the box to accept the terms and conditions.
-
Submit the form:
- Click the "Submit" button to save your information.
- If any required fields are missing or if the terms are not accepted, you will see a warning message.
-
Data Storage:
- The data will be stored in a file named
data.dbin the same directory as the script. - The database contains a table named
Student_Datawhere all the form submissions are stored.
- The data will be stored in a file named
This function is called when the "Submit" button is clicked. It performs the following tasks:
- Checks if the terms and conditions are accepted.
- Validates that both the first name and last name are provided.
- Collects all data from the form fields.
- Creates a SQLite database and table if they do not exist.
- Inserts the collected data into the database.
- The main window is created using
tkinter.Tk(). - The form is divided into several sections using
LabelFramefor better organization. - Widgets such as
Label,Entry,Combobox,Spinbox,Radiobutton, andCheckbuttonare used to create the form fields. - The submit button is created using
Buttonand is linked to theenter_datafunction.
The SQLite database data.db contains a table Student_Data with the following schema:
firstname: TEXTlastname: TEXTtitle: TEXTage: INTEGERnationality: TEXTregistration_status: TEXTnum_courses: INTEGERnum_semesters: INTEGER
For any issues or questions, please contact [[email protected]].