Calendar widget for Tkinter
Project description
tkcalendar
tkcalendar is a calendar widget for Tkinter. It is compatible with both Python 2 and Python 3. It support all locale setting supported by the system and the colors are customizable.
Requirements
Linux, Windows, Mac
Python 2 or 3 with tkinter + ttk (default for Windows but not for Linux)
Installation
Ubuntu:
$ dpkg -i python(3)-tkcalendar_x.y.z-1_all.deb
Archlinux: the package is available on AUR
With pip:
$ pip install tkcalendar
Documentation
Syntax:
Calendar(master=None, **kw)
Widget keyword options:
Standard options
cursor: cursor to display when the pointer is in the widget
font: font of the calendar, can be a string such as “Arial 20 bold” or a Tkinter Font instance
Widget-Specific Options
year, month: initially displayed month, default is current month
day: initially selected day, if month or year is given but not day, no initial selection, otherwise, default is today
locale: locale to use, e.g. “fr_FR” for a French calendar
selectmode: “none” or “day” (default) define whether the user can change the selected day with a mouse click
background: border and month/year name background color
foreground: border and month/year name foreground color
selectbackground: selected day background color
selectforeground: selected day foreground color
normalbackground: normal week days background color
normalforeground: normal week days foreground color
othermonthforeground: foreground color for days belonging to the previous/next month
weekendbackground: week-end days background color
weekendforeground: week-end days foreground color
headersbackground: day names and week numbers background color
headersforeground: day names and week numbers foreground color
Virtual Events
A <<CalendarSelected>> event is generated each time the selected day changes.
Changelog
- tkcalendar 1.0.0
Initial version
Example
try:
from tkinter import Tk, Button
except ImportError:
from Tkinter import Tk, Button
from tkcalendar import Calendar
def print_sel():
print(cal.selection_get())
root = Tk()
cal = Calendar(root, locale="fr_FR.UTF-8",
font="Arial 12",
cursor="hand1", year=2018, month=2, day=5)
cal.pack(fill="both", expand=True)
Button(root, text="ok", command=print_sel).pack()
root.mainloop()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tkcalendar-1.0.0.tar.gz.
File metadata
- Download URL: tkcalendar-1.0.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58ac9f6fb435598c106244e82a46ab114a328d20d2e50e7654b52e610effce8e
|
|
| MD5 |
7d6a2b90afc2bcd51897622b660a1ceb
|
|
| BLAKE2b-256 |
9bf0ccfa25bcc01afdb7e29e02b7f4bcd8f61ec1816a90c2aa74ea6b3d9ce534
|
File details
Details for the file tkcalendar-1.0.0-py3.6.egg.
File metadata
- Download URL: tkcalendar-1.0.0-py3.6.egg
- Upload date:
- Size: 14.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5658fde47783a3c9ba4706f0a90fa32dd566cebc8b31ddbc2020f18ca9fe8b6
|
|
| MD5 |
6da9718cea04db6558c34726082bc32e
|
|
| BLAKE2b-256 |
ffe548740168139ec49de24be2e64049635e42ffb95cd0376a7e239c7baa4c53
|
File details
Details for the file tkcalendar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tkcalendar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f9e3af138ad93c4f90ced45a57d9eb778e031208900f588dcc55853a314258e
|
|
| MD5 |
166f471a492953973757de1769182edf
|
|
| BLAKE2b-256 |
0bc6321b2a5693ee0430e3b54ec0d5815b12dbcf20485f817ca24d78fec3f044
|