Amazing-Python-Scripts
78 строк · 2.7 Кб
1import tkinter as tk
2from tkinter import ttk
3
4
5class PortfolioApp(tk.Tk):
6def __init__(self):
7super().__init__()
8self.title("My Portfolio")
9self.geometry("400x300")
10
11self.create_widgets()
12
13def create_widgets(self):
14# Create a label for the title
15title_label = ttk.Label(
16self, text="Welcome to My Portfolio", font=("Helvetica", 16))
17title_label.pack(pady=10)
18
19# Create a button to go to the projects page
20projects_button = ttk.Button(
21self, text="View Projects", command=self.show_projects)
22projects_button.pack(pady=5)
23
24# Create a button to show more information
25more_info_button = ttk.Button(
26self, text="More Information", command=self.show_more_info)
27more_info_button.pack(pady=5)
28
29# Create a button to exit the app
30exit_button = ttk.Button(self, text="Exit", command=self.destroy)
31exit_button.pack(pady=5)
32
33def show_projects(self):
34projects_window = tk.Toplevel(self)
35projects_window.title("My Projects")
36projects_window.geometry("400x300")
37
38# Create a label for the projects page
39projects_label = ttk.Label(
40projects_window, text="List of Projects", font=("Helvetica", 16))
41projects_label.pack(pady=10)
42
43# Create project descriptions (you can add more as needed)
44project1_label = ttk.Label(
45projects_window, text="Project 1: Description of project 1.")
46project1_label.pack(pady=5)
47
48project2_label = ttk.Label(
49projects_window, text="Project 2: Description of project 2.")
50project2_label.pack(pady=5)
51
52def show_more_info(self):
53info_window = tk.Toplevel(self)
54info_window.title("More Information")
55info_window.geometry("400x300")
56
57# Create labels for more information
58info_label = ttk.Label(
59info_window, text="Experience, Skills, and Contact Details", font=("Helvetica", 16))
60info_label.pack(pady=10)
61
62# Add more labels here for additional information about yourself
63experience_label = ttk.Label(
64info_window, text="Experience: Describe your work experience here.")
65experience_label.pack(pady=5)
66
67skills_label = ttk.Label(
68info_window, text="Skills: List your skills here.")
69skills_label.pack(pady=5)
70
71contact_label = ttk.Label(
72info_window, text="Contact: Your contact details (email, phone, etc.).")
73contact_label.pack(pady=5)
74
75
76if __name__ == "__main__":
77app = PortfolioApp()
78app.mainloop()
79