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!!!
Here is something very simple that you can fancy up with a +/- year and a +/- month button:
# 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()
# pick a fixed font like courier so spaces behave right
label1 = tk.Label(root, text=str1, font=('courier', 14, 'bold'), bg='yellow')
# run the event loop (needed)
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.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...