[Tutor] now = ctime()[11:20]

Alan Gauld alan.gauld at btinternet.com
Sat Jul 17 09:03:10 CEST 2010


"Richard D. Moores" <rdmoores at gmail.com> wrote 

> but then I began to wonder how to create an "alias" for
> "ctime()[11:20]" so I wouldn't have to keep typing or pasting it.
> "now" would be fine. But how to get it to execute ctime()?

Create a function?

def myNow():
     return ctime()[11:20]

Or am I missing something?


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list