Python實列 計時器呼叫

2021-04-13 00:11:11 字數 845 閱讀 2718

1.#fout.py python中對於計時器的呼叫....顯示...

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

試試:>>>fo=fout()

>>>fo.tcout(1,10,"en?...aha...!")

>>>fo.sout(1,["en...?","aha...!"])

Python實列 計時器呼叫

1.fout.py python中對於計時器的呼叫.顯示.from dummy threading import class fout this class contain some functions to display.defualt string wait.system is waiting...

python計時器 python 計時器

import sysclassshowtime qwidget def init self super init self.istimestart false 標記時間是否開始計時 self.setwindowtitle qlable 顯示計時時間 self.lable time val qlabe...

python計時器單位 python計時器類

import time as t class mytimer def init self self.unit 年 月 日 時 分 秒 self.prompt 未開始計時 self.lasted self.start 0 self.stop 0 def str self return self.pro...