0% found this document useful (0 votes)
2 views5 pages

Python Programs

The document contains Python code defining classes for managing participants, organizers, activities, and events, along with a Tkinter GUI for a student form and a login interface. The Event class consolidates details from the Participant and Organizer classes and displays them. Additionally, the GUI components allow users to input their name and branch, and validate login credentials with a simple message box feedback.

Uploaded by

Mayank Kanojiya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Python Programs

The document contains Python code defining classes for managing participants, organizers, activities, and events, along with a Tkinter GUI for a student form and a login interface. The Event class consolidates details from the Participant and Organizer classes and displays them. Additionally, the GUI components allow users to input their name and branch, and validate login credentials with a simple message box feedback.

Uploaded by

Mayank Kanojiya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

# Participant Class

class Participant:

def get_p(self, name_p, email):

self.name_p = name_p

[Link] = email

# Organizer Class

class Organizer(Participant):

def get_o(self, name_o, contact):

self.name_o = name_o

[Link] = contact

# Activity Class

class Activity(Organizer):

def getac(self, name_a, time, location):

self.name_a = name_a

[Link] = time

[Link] = location

# Event Class

class Event(Activity):

def __init__(self, name_e, date):

self.name_e = name_e

[Link] = date
def show_details(self):

print("participants name",self.name_p)

print("participants email",[Link])

print("organizer name",self.name_o)

print("organizer contact",[Link])

print("activity name",self.name_a)

print("activity time",[Link])

print("activity location",[Link])

print("event name",self.name_e)

print("event date",[Link])

ob=Event("technofest","24/3/2026")

ob.get_p("suwarna","ss@[Link]")

ob.get_o("tsec",123456789)

[Link]("quiz","11:00am","lab-cc1")

ob.show_details()
import tkinter as tk

def submit():

name = name_entry.get()

branch = branch_var.get()

output=f"your name is {name}.\n"

output+=f"{name} is from {branch} department.\n"

result_label.config(text=output)

# Create window

root = [Link]()

[Link]("Student Form")

# Name

[Link](root, text="Enter Student Name:").grid(row=0, column=0)

name_entry = [Link](root)

name_entry.grid(row=0, column=1)

# Branch (Radio Buttons)

[Link](root, text="Select Your Branch:").grid(row=1, column=0)

branch_var = [Link](value="Computer Engineering")

[Link](root, text="Computer Engineering", variable=branch_var,value="computer


engineering").grid(row=1, column=1)
[Link](root, text="Information Technology", variable=branch_var,value="information
technology").grid(row=1,column=2)

# Submit Button

[Link](root, text="Submit", command=submit).grid(row=3, column=1)

# Output Label

result_label=[Link](root, text="", fg="blue", justify="left")

result_label.grid(row=4, column=0, columnspan=4)

# Run

[Link]()

import tkinter as tk

from tkinter import messagebox

def validate_login():

userid = [Link]()

password = [Link]()

# You can add your own validation logic here

if userid == "admin" and password == "password":

[Link]("Login Successful", "Welcome, Admin!")


else:

[Link]("Login Failed", "Invalid username or password")

root=[Link]()

[Link]("welcome")

[Link]("300x300")

l1=[Link](root,text="enter name")

[Link]()

el=[Link](root)

[Link]()

p1=[Link](root,text="enter password")

[Link]()

ep=[Link](root,show="*")

[Link]()

login=[Link](root,text="login",command=validate_login)

[Link]()

[Link]()

You might also like