- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
secs = 0
fsecs = 0.0
mins = 40
lastsecs = 0
prevsecs = 0
def getTimeStr() :
def f ( x ) :
if ( 10 <= x <= 19 ) : return ''
y = x % 10
if ( y == 1 ) : return 'а'
if ( 2 <= y <= 4 ) : return 'ы'
return ''
return 'Время: %d минут%s %d секунд%s' % ( mins , f ( mins ) , secs , f ( secs ) )
def updateTimer() :
global timeString , root , secs , fsecs , lastsecs , prevsecs , mins
if ( fin ) : return
prevsecs , lastsecs = lastsecs , clock()
t = secs
if ( fsecs > 0 ) :
fsecs -= lastsecs - prevsecs
secs = int ( fsecs )
elif ( mins > 0 ) :
mins -= 1
fsecs = 60 + fsecs - lastsecs + prevsecs
secs = int ( fsecs )
else :
finish()
if ( secs == t ) :
timeString [ 'text' ] = getTimeStr()
root.after ( 100 , updateTimer )
shit_again 12.05.2018 18:28 # −2
guest8 13.05.2018 17:58 # −999
subaru 12.05.2018 18:33 # −1
syoma 13.05.2018 01:49 # −1
roskomgovno 14.05.2018 00:59 # −1
фуу
Namespaces are one honking great idea -- let's do more of those!
guest8 14.05.2018 20:21 # −999
Alexander 14.05.2018 22:10 # 0