1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import time
import Tkinter as tk
b = True
i = 0

def counter():
  global i
  while b == True:
    global i  
    time.sleep(1)
    i+= 1 
    print i
  if b == False:
    print i
  
  
counter()