Question: how to combine 2 functions in one button module : python3 # run when user click command botton def airodump_command(): print(processing airodump-ng) command =airodump-ng -w

how to combine 2 functions in one button

module : python3

# run when user click command botton def airodump_command(): print("processing airodump-ng") command ="airodump-ng -w /root/Desktop/output --output-format csv wlan0mon &" result = subprocess.run(command, timeout= 15, shell=True, capture_output=True, text=True) return command

# load output csv def load_csv_data(): # choose the lastest output csv lastest_csv_file = glob.glob("/root/Desktop/*.csv") imported_file = max(lastest_csv_file , key=os.path.getctime) col_list = ["BSSID", "channel", "Privacy", "Authentication", "ESSID"] # will show value error when csv file have space between colume # skipinitialspace=True, used for ignore csv file strip white space df = pd.read_csv(imported_file, usecols = col_list, skipinitialspace = True)

# button for airodump-ng, scan target button1 = tk.Button(button_frame, text="Scan APs", command=airodump_command) button1.grid(row=1, column=0, sticky="W")

# button for load csv file button2 = tk.Button(button_frame, text="Load File", command=load_csv_data) button2.grid(row=1, column=1, sticky="W")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!