forked from technojam/Hacktoberfest-2020-Baby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar_gui.py
33 lines (30 loc) · 988 Bytes
/
calendar_gui.py
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
#importing libraries
#pip install PyQt5
from PyQt5.QtWidgets import *
from PyQt5 import QtCore , QtGui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Calendar")
self.setGeometry(100,100,600,400)
self.UiComponents()
self.show()
def UiComponents(self):
calendar=QCalendarWidget(self)
calendar.setGeometry(10,10,400,250)
push=QPushButton("Next Year",self)
push2=QPushButton("Previous Year",self)
push2.setGeometry(60,280,100,40)
push2.clicked.connect(lambda: do_action2())
def do_action2():
calendar.showPreviousYear()
push.setGeometry(180,280,100,40)
push.clicked.connect(lambda: do_action())
def do_action():
calendar.showNextYear()
app=QApplication(sys.argv)
window=Window()
sys.exit(app.exec())