chan 06's Profile
Reputation: 2 Apprentice
- Active Members
- Active Posts:
- 63 (0.09 per day)
- 07-October 12
- Profile Views:
- Last Active:
- Feb 06 2014 04:07 AM
- Dream Kudos:
Posts I've Made
Posted 9 Jan 2014I would like to open a text document automatically
I was thinking something like this.
f = open("document.txt", "o") f.close()
Posted 16 Dec 2013I solved it, I needed to place a two frames around my listbox. My frame would use place() while my listbox need to use pack(). By creating a frame it will adjust the height on scrollbar that would accommodate the height of your widget.
Posted 14 Dec 2013Thanks for clarifying, learning slowly with tkinter barely did any gui programming before.
Posted 1 Jul 2013Thank you a lot JackOfAllTrades
Posted 29 Jun 2013I am trying to display each month of the year and the number of days for each month. My code is running 12 times and not sure how to make it run only once.
month = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] days_Month =[31,28,31,30,31,30,31,31,30,31,30,31] for index in range(len(month)): for index in range(len(days_Month)): print ("%s %3d" % (month[index],days_Month[index])) break
Your program is perfectly fine, you just made a small error. You forgot to add a percent sign % at line 6:
print ('%s %3d' % (month[index],days_Month[index]))
In addition, an addition tip make sure to add brackets when you are printing because in Python 3.x, print() is no longer a statement but a function.
My bad your program has run 144x, repeating twelve times. add a break to the i-loop so that the program only run 12x
(0,0), (0,1), (0,2), (0,3),(0,4), (0,5), (0,6), (0,7), (0,8), (0, 9), (0,10), (0,11), (0,12)
You don't want your i-loop to iterate through one more time. Or else you would get:
(1,0), (1,1)..., (1,12)
Meaning that your program will run one more time.
H Hopefully that made some sense.
- Member Title:
- D.I.C Head
- Age Unknown
- Birthday Unknown
chan 06 hasn't added any friends yet.