from tkinter import *

def foo(text):
    if text == 'qwer':
        print('first button clicked')
    elif text == 'asdf':
        print('second button clicked')
    
win = Tk()
b = Button(win, text='click here', command=lambda event='<Button-1>' : foo('qwer'))
b1 = Button(win, text='click me', command=lambda event='<Button-1>' : foo('asdf'))
b.grid()
b1.grid()

win.mainloop()