0% found this document useful (0 votes)
6 views3 pages

71 Py 7

It's a python program

Uploaded by

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

71 Py 7

It's a python program

Uploaded by

arpitamohan3005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

WPPY laltiBtkpy

Digitalclock.py >..
1 import tkinter as tk
2 import time

4 class Digitalclockt

definit_(self, root):
self.root root

self.root.title("Digital Clock")

9 # Create a label todisplay the time


10 self.time label = tk.Label (root,font-("Helvetica", 48), bg="black", fg-"white")
self.time_ label.pack(pady=20)
11
Digital Clock
12

self.update_clock()
13
I
14
15
16
17
def update_clock(self):
# Get the current time
current time = time.strftime ("%H:%M:%S")
20:57:13
12
19 # Update the label with the current time
20 self.time label.config(text=current time)
21
22 # Call this method again after 1000 milliseconds (1 second)
23
self.root.after (1OO0, self.update_clock)
24
25 # Create the main window
26 root = tk.Tk()
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS
ython t 0 a

PS C:\Vscodeiorkspace\PYTHON> & C:/Users/hp/AppData/


Local/Programs/Python/Python312/python.exec:/VScodetiorkspace/PYTHON/Dgitalclock-py

Ln 33, Col 1 Spaces: 4 UTF-8 CRLF ()Python 3.12.5

Q Search
ENG
IN
20:57
09-10-2024
•font-py Release Notes: 1.94.0 ffpy Digitalclockpy GUlpassword.py X
1
GUlpassword.py .
import tkinter as tk
2 import random
3 import string

5 class PasswordGenerator:
6 def init_ (self, root):
self.root = root Ranio.

self.root.title("Random Password Generator") Password Length:

10 # Label for password length


11
self.length label = tk.Label(root,
12 text="Password Length:") Generate Password
self.length label.pack(pady-5)
13
14
# Entry to input the
length of the password
15
self.length entry = tk.Entry(root) b'_@s
16
self.length_entry.pack(pady=5)
17
18 # Button to generate the
19 password
20 self.generate button =
tk. Button(root,
text="Generate Password",
self.generate button.pack(pady=10) command=self.generate password)
21
22
# Label to display the
23 generated password
Py

MMER.. 24
self.password label =
tk. Label (root, text="",
fontt=("Helvetica", 14)
25 self.password_label.pack(pady-20)
26
def generate pas sword(self):
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS

PS
C:\VScodeiorkspace\PYTHON>& Python t 0
C:/Users/hp/AppData/Local/Programs/Python/Python312/python . exe
c:/NScodeWorkspace/PYTHON/GUIpassword.py

Q Search Ln 53, Col 1 Spaces: 4 UTF-8

ENG
CRLF ) Python 3.12.5

21:01
IN 09-10-2024
font-py Release Notes: 1.94.0 • fffpy • Digitalcdockpy GUlpassword,py GUlalertmessage.pyX
GUlalertmessage.py ...

1 import tkinter as tk
2 from tkinter import messagebox
3 7 Aler..
4 class AlertMessageApp:
5 def init_(self, root):
6 self.root root = Show Alert

self.root.title (""Alert Message Example")


8
# Create a button that triggers the alert message
10 self.alert button = tk.Button(root, text="show Alert", command=self. show_alert)
11 self.alert button.pack(pady-20)
12
13 def show_alert (self):
14 # Show an alert message box
15 messagebox. showinfo("Alert", "This is an alert message !")
16
17 # Create the main window Alert X
18 root = tk.Tk()
19
20 # Create an instance of the AlertMessageApp This is an alert message!
class
21 app = AlertMessageApp(root)
22
23 # Start the Tkinter event loop OK
24 root .mainloop ()
25
MER...

PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL PORTS


Python t 0
PS C:\VScodeWorkspace\PYTHON>&
C:/Users/hp/AppData/ LOcal/Programs/Python/Python312/python.exe
c:/NScodeworkspace/PYTHON/GUTalertmessage.py

Ln 25, Col 1 Spaces: 4 UTF-8 CRLF ()Python 3.12.5

Q Search ENG 21:04


IN 09-10-2024

You might also like