Sorry everyone
I have worked this out. The more obvious the solution the harder it is for me to find.
Sorry
Hi
I am a little stuck on a python problem that must have an easy answer and I was hoping one of the Gurus could point me in the right direction as I am no python expert.
I have two lists to compare/reference??
code below
import time
cont=GameLogic.getCurrentController()
own=cont.getOwner()
from time import localtime
time=localtime()
year=time[0]
print year
month=time[1]
monthname=[“January”, “February”, “March”, “April”, “May”, “June”,
“July”, “August”, “September”, “October”, “November”, “December”,]
print monthname
month is a integer list 1-12 and monthname is a list of 12 strings(obviously).
You should be able to see where I am going with this. Is there an easy way to reference? these lists together so I dont have to do…
if month[0]==1:
displaymonth=monthname[0]
etc twelve times
I have had a good look in the python docs but I’m not sure what I am looking for.
Thanking Everybody in Advance
Dr S
PS I have posted this in the python forum as well as the Game Engine