title: Is there a way to make a conditional statement based on whether or not someone presses a button (tkinter)
body: <p>Here is my code:</p>
  
  <pre><code>    root = tkinter.Tk()
  
      canvas = tkinter.Canvas(root, width=960, height=720)
      image = ImageTk.PhotoImage(Image.open('TitleScreen.png'))
  
      canvas.create_image(0, 0, anchor=tkinter.NW, image=image)
      canvas.create_text(485, 375, font=("Times", 25, 'bold'),
                         text='You live in Valencia, Venezuela. You have 2 kids, and a '
                              '\n'
                              'significant other. You barely have enough money to take care '
                              '\n'
                              'of your family, food is running out, and electricity outages '
                              '\n'
                              'are a daily occurrence. Do you  want to leave in search '
                              '\n'
                              'of a better life? [y/n]', fill='white')
  
      y = Button(root, text='Y', command=buttonFunctionY, bg='black', bd=5, font=('Times', 20), activebackground='blue',
                 activeforeground='black', fg='black')
      y.place(x=435, y=465)
  
      n = Button(root, text='N', command=buttonFunctionN, bg='black', bd=5, font=('Times', 20), activebackground='blue',
                 activeforeground='black', fg='black')
      n.place(x=485, y=465)
  
      if option == 'y':
          canvas.create_image(0, 0, anchor=tkinter.NW, image=image)
          canvas.create_text(485, 375, font=("Times", 25, 'bold'),
                             text='Great, good decision. First should you prepare for the trip by buying supplies? [y/n]',
                             fill='white')
  
      canvas.pack()
  
      root.mainloop()
  </code></pre>
  
  <p>My main problem is near the end, where I tried to create a conditional based on whether the button is pressed but I have no idea how to do so.</p>