click on button to send adb commmand python
<p>I would like to build a program to send adb commannd to mobile when i click
the buttton, i tried with the following code but the command is not send to device,I'm new in Python.
Please can someone help me to solve this problem</p>

<pre><code>from Tkinter import *
import os
import subprocess

root = Tk()
root.title("MUT Tester")
root.geometry("500x500")

def button():

cmd= os.system("adb devices")


b = Button(root, text="Enter", width=30, height=2, command = lambda:(button))
b.pack()

root.mainloop()
</code></pre>

<p>In this line:</p>

<pre><code>b = Button(root, text="Enter", width=30, height=2, command = lambda:(button))
</code></pre>

<p>the button function is not being called by command when you click (replace button with a print statement to test). Remove the lambda and replace it with just command = button.</p>

android python