-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtkinter(switch).py
More file actions
63 lines (63 loc) · 2.09 KB
/
tkinter(switch).py
File metadata and controls
63 lines (63 loc) · 2.09 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# import tkinter as tk
#
# class MainApp(tk.Tk):
# def __init__(self):
# tk.Tk.__init__(self)
# self._frame = None
# self.switch_frame(Login)
#
# def switch_frame(self,frame_class):
# new_frame = frame_class(self)
# if self._frame is not None:
# self._frame.destroy()
# self._frame = new_frame
# self._frame.pack()
#
# class Login(tk.Frame):
# def __init__(self,master):
# tk.Frame.__init__(self,master)
# tk.Label(self, text ="This is the Login page").pack()
# tk.Button(self,text = "Open Employee page",
# command = lambda : master.switch_frame(Employee)).pack()
# tk.Button(self,text = "Open Department Page",
# command = lambda :master.switch_frame(Department)).pack()
# tk.Button(self,text = "Open College Page",
# command = lambda :master.switch_frame(College)).pack()
#
# class Employee(tk.Frame):
# def __init__(self,master):
# tk.Frame.__init__(self,master)
# tk.Label(self, text = "This is Employee Page").pack()
# tk.Button(self, text = "Return to Login Page",
# command = lambda :master.switch_frame(Login)).pack()
#
# class Department (tk.Frame):
# def __init__(self,master):
# tk.Frame.__init__(self,master)
# tk.Label(self, text = "This is Department Page").pack()
# tk.Button(self, text = "Return to Login Page",
# command = lambda :master.switch_frame(Login)).pack()
#
# class College (tk.Frame):
# def __init__(self,master):
# tk.Frame.__init__(self,master)
# tk.Label(self, text = "This is college Page").pack()
# tk.Button(self, text = "Return to Login Page",
# command = lambda :master.switch_frame(Login)).pack()
#
# app=MainApp()
# app.mainloop()
def syn(n):
if n <1:
raise ValueError("error")
elif n == 1 or n ==2:
return 1
else:
a = 1
b = 1
for i in range(3,n+1):
tem = a+b
a = b
b = tem
return b
print(syn(5))