title: multiprocessing with tkinter
body: <p>I am trying to run several timers in a tkinter window, using multiprocessing, which I never used before.
  I can't figure out why when first timer is running and I start the second one, the first one stops.
  The same happens when I start the second timer first and then click on any button of the first timer.
  I can't make both timers run at the same time.</p>
  <pre><code>import time
  import datetime
  from tkinter import *
  import tkinter as tk
  import tkinter.font as TkFont
  from time import strftime
  from multiprocessing import Process
  from tkinter import messagebox
  
  
  def count_down_drink():
      global count_flag_drink
      count_flag_drink = True
  
      try:
          temp = int(hour_drink.get()) * 3600 + \
              int(minute_drink.get()) * 60 + int(second_drink.get())
  
      except:
          print(&quot;Please input the right value&quot;)
      while temp &gt; -1:
          if count_flag_drink == False:
              break
          mins, secs = divmod(temp, 60)
  
          hours = 0
          if mins &gt; 60:
  
              hours, mins = divmod(mins, 60)
  
          hour_drink.set(f&quot;{hours:2d}&quot;)
          minute_drink.set(f&quot;{mins:2d}&quot;)
          second_drink.set(f&quot;{secs:2d}&quot;)
  
          root.update()
          time.sleep(1)
  
          if (temp == 0):
              messagebox.showinfo(&quot;Time Countdown&quot;, &quot;Time's up &quot;)
  
          temp -= 1
  
  # food
  
  
  def count_down_food():
      global count_flag_food
      count_flag_food = True
  
      try:
          temp = int(hour_food.get()) * 3600 + \
              int(minute_food.get()) * 60 + int(second_food.get())
  
      except:
          print(&quot;Please input the right value&quot;)
      while temp &gt; -1:
          if count_flag_food == False:
              break
          mins, secs = divmod(temp, 60)
  
          hours = 0
          if mins &gt; 60:
  
              hours, mins = divmod(mins, 60)
  
          hour_food.set(f&quot;{hours:2d}&quot;)
          minute_food.set(f&quot;{mins:2d}&quot;)
          second_food.set(f&quot;{secs:2d}&quot;)
  
          root.update()
          time.sleep(1)
  
          if (temp == 0):
              messagebox.showinfo(&quot;Time Countdown&quot;, &quot;Time's up &quot;)
  
          temp -= 1
  
  
  def main():
      p1 = Process(target=count_down_drink)
      p1.start()
      p2 = Process(target=count_down_food)
      p2.start()
  
  
  if __name__ == '__main__':
  
      root = Tk()
  
      root.geometry(&quot;700x500&quot;)
  
      root.rowconfigure((0, 1, 2, 3, 4, 5, 6), weight=1)
      root.columnconfigure((0), weight=8,  uniform='a')
      root.columnconfigure((7), weight=1,  uniform='a')
      root.columnconfigure((1, 2, 3, 4, 5, 6), weight=4,  uniform='a')
  
      root.title(&quot;2 Timers&quot;)
      root.configure(bg='#282932')
      root.resizable(width=0, height=0)
  
      # Declaration of variables
      hour_drink = StringVar()
      minute_drink = StringVar()
      second_drink = StringVar()
  
      hour_drink.set(&quot;04&quot;)
      minute_drink.set(&quot;00&quot;)
      second_drink.set(&quot;00&quot;)
  
      hour_food = StringVar()
      minute_food = StringVar()
      second_food = StringVar()
  
      hour_food.set(&quot;04&quot;)
      minute_food.set(&quot;00&quot;)
      second_food.set(&quot;00&quot;)
  
      # --------------- drink -----------------------------
      drink_event_name = Entry(root, width=10, font=(
          'Fira Code', 18), fg='white', bg='#5789d9', justify='center', borderwidth=6)
      drink_event_name.grid(row=0, column=0)
  
      drink_hourEntry = Entry(root, width=3, font=('Fira Code', 16), fg='#99ceff', bg='#5a605c', justify='center', borderwidth=1,
                              textvariable=hour_drink)
      drink_hourEntry.grid(row=0, column=1)
  
      drink_event_name.focus_set()
  
      drink_minuteEntry = Entry(root, width=3, font=('Fira Code', 16), fg='#99ceff', bg='#5a605c', justify='center', borderwidth=1,
                                textvariable=minute_drink)
  
      drink_minuteEntry.grid(row=0, column=2)
  
      drink_secondEntry = Entry(root, width=3, font=('Fira Code', 16), fg='#99ceff', bg='#5a605c', justify='center', borderwidth=1,
                                textvariable=second_drink)
  
      drink_secondEntry.grid(row=0, column=3)
  
      drink_btn_down = Button(root, text='DOWN',  fg='#99ceff', bg='#32475a',
                              font=('Fira Code', 12), borderwidth='7', width=7, command=count_down_drink)
      drink_btn_down.grid(row=0, column=5)
  
      # --------------- food -----------------------------
      food_event_name = Entry(root, width=10, font=(
          'Fira Code', 18), fg='white', bg='#5789d9', justify='center', borderwidth=6)
      food_event_name.grid(row=1, column=0)
  
      food_hourEntry = Entry(root, width=3, font=('Fira Code', 16), fg='#99ceff', bg='#5a605c', justify='center', borderwidth=1,
                             textvariable=hour_food)
      food_hourEntry.grid(row=1, column=1)
  
      food_event_name.focus_set()
  
      food_minuteEntry = Entry(root, width=3, font=('Fira Code', 16), fg='#99ceff', bg='#5a605c', justify='center', borderwidth=1,
                               textvariable=minute_food)
  
      food_minuteEntry.grid(row=1, column=2)
  
      food_secondEntry = Entry(root, width=3, font=('Fira Code', 16), fg='#99ceff', bg='#5a605c', justify='center', borderwidth=1,
                               textvariable=second_food)
  
      food_secondEntry.grid(row=1, column=3)
  
      food_btn_down = Button(root, text='DOWN',  fg='#99ceff', bg='#32475a',
                             font=('Fira Code', 12), borderwidth='7', width=7, command=count_down_food)
      food_btn_down.grid(row=1, column=5)
  
      # food end -----------------------------------------------------------------
  
      root.mainloop()
  </code></pre>