1. # Call the timer in fout. py python... display...
From dummy_threading import *
Class fout:
"This class contain some functions to display ..."
_ Defualt_string = "Wait... system is waiting ......"
_ Arg = ["start...", "... end"]
Def out (self, I = 0, string = _ defualt_string ):
Print string
Print I, "seconds left ..."
Print
# Print "...". Join (string)
Def tout (self, SEC = 1, Times = 1, string = _ defualt_string ):
For I in range (times ):
T = timer (SEC, self. Out, [SEC * (times-I), string])
T. Start ()
Print "... end"
Def sout (self, SEC = 1, Arg = _ Arg ):
For SS in Arg:
T = timer (SEC, self. Out, ["#", SS])
T. Start ()
Pass
# End of fout. py
Try:
>>> Fo = fout ()
>>> Fo. tcout (1, 10, "En ?... Aha ...! ")
>>> Fo. sout (1, ["En ...? "," Aha ...! "])
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/nightiger/archive/2007/05/13/1607279.aspx