954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

tkinter calendar

hi everybody , I am new to python and interested in graphics . I like somebody to walk me thru monthly calendar using tkinter . I have already printed 07 calendar using python but I am stuck when it comes to use it with tkinter . it is no homework , I am 50 years old and have passed all my exams!!!
thanks

fonzali
Light Poster
25 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

Hi!

I once wrote a Calendar widget for Tkinter. You can find it here (it's a german forum, but the code is in english :)):
http://www.python-forum.de/topic-1835.html

You can also find two improvements posted by some others in this thread.
If you have any questions, feel free to ask ;)

Regards, mawe

mawe
Junior Poster
133 posts since Sep 2005
Reputation Points: 19
Solved Threads: 58
 

Here is something very simple that you can fancy up with a +/- year and a +/- month button:
[php]# as simple monthly calendar with Tkinter

# give calendar and Tkinter abbreviated namespaces
import calendar as cd
import Tkinter as tk

# supply year and month
year = 2007
month = 2 # jan=1

# assign the month's calendar to a multiline string
str1 = cd.month(year, month)

# create the window form and call it root (typical)
root = tk.Tk()
root.title("Monthly Calendar")

# pick a fixed font like courier so spaces behave right
label1 = tk.Label(root, text=str1, font=('courier', 14, 'bold'), bg='yellow')
label1.pack(padx=3, pady=5)

# run the event loop (needed)
root.mainloop()
[/php]

Ene Uran
Posting Virtuoso
1,723 posts since Aug 2005
Reputation Points: 625
Solved Threads: 213
 

thanks , Ilooked at the code and it seems not so easy for me to digest but I will do my best , thanks again

fonzali
Light Poster
25 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

thanks , it was simple enough to undrestand . thanks again

fonzali
Light Poster
25 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
thanks , Ilooked at the code and it seems not so easy for me to digest but I will do my best , thanks again

If this is your first experience with GUI programming, it will take some time to digest. However, playing with labels, buttons, windows and mouse clicks is fun, once you get the hang of it. Keep experimenting with the code! There are quite a number of good Tkinter GUI examples on this forum.

Also, welcome to the Python forum!!!!

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You