首页 > 代码库 > python sb 问题

python sb 问题

PROGRAM_MAX_LENGTH = 60*60*3 #3 hours
skiptimes = 0
TOTALTIMES = 0

 

def xxx():

  print TOTALTIMES       #fine    consider it as constant

  #TOTALTIMES += 1       #NOT OK   

       global TOTALTIMES

  TOTALTIMES += 1   #OK