[Solved] - I have an array of all the days off the week. I also have a var with the name of the current day written like "Tuesday". How do I search the array of days for my current day and get an integer returned speaking to where the instance is.
Code:now = datetime.datetime.now() curDay = now.strftime("%A") weekDays = ("Monday", "Tuesday", "Wednesday", "Thurday", "Friday", "Saturday", "Sunday") intDay = # this where I would search for curDay in weekDays cmbDay.set_active(intDay) # set the combo to the current day
Last edited by mevets; 10-09-2007 at 07:39 PM.
I had to change
toCode:weekDays = ("Monday", "Tuesday", "Wednesday", "Thurday", "Friday", "Saturday", "Sunday")
and to find where the day was in the array of days ICode:weekDays = ["Monday", "Tuesday", "Wednesday", "Thurday", "Friday", "Saturday", "Sunday"]
So hard to find on googleCode:weekDays.index(curDay)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks