Python real column: timer call

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.