creating instances of classes?
Shaun Hogan
shogan at iel.ie
Thu Mar 9 04:50:24 EST 2000
i want the code below to tell me the current time & date when i execute it,
i dont know how to make an instace of telltime though, can anyone correct
if for me.
thanks
Shaun
#filename:dat.py
class telltime:
def __init__(self,time,date):
import time
self.time==time.localtime(time.time())[3:6]
self.date==time.localtime(time.time())[0:3]
self.time=time
self.date=date
def op(self):
print self.time
print self.date
t=telltime(time,date)
print t.op()
More information about the Python-list
mailing list