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
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
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417