[Tutor] output question

w chun wescpy at gmail.com
Sat Oct 15 03:33:06 CEST 2005


On 10/14/05, Shi Mu <samrobertsmith at gmail.com> wrote:
>
> I found the code for class "now". I got confused by two things:
> First, how did the former code I posted know to import tis module of
> "Now";
> Second. what does "\" mean following "self.year,"
> Thanks a lot!
>
> class now:
>
> def __str__(self):
> return time.ctime(self.t)
> def __repr__(self):
> return time.ctime(self.t)
>

you mean you didn't write the "former code?" why are you asking for help
with code that you did not write? your output is caused by the 2 now methods
above. the '\' is the continuation character in Python. are you learning
Python on your own?

-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2006,2001
http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com <http://wescpy-at-gmail.com>
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051014/a3ca1fd7/attachment.html


More information about the Tutor mailing list