I'm writing a python code to run the tshark (wireshark) command with subprocess.Popen. Program working as expected. But when I've converted my program in GUI with tkinter, it is always opening blank command prompt for tshark which is annoying. part of the code is shared below. Can someone please help on this. just for info PATH_TSHARK and FILTER is my variable defined
for _f in files:
path_out = 'myfolder/'+os.path.basename(_f)
command = []
command.append(PATH_TSHARK)
command.append('-r') ; command.append(_f)
command.append('-w'); command.append(path_out)
command.append('-2')
command.append('-R'); command.append(FILTER)
sp = subprocess.Popen(command, stdout=FNULL, stderr=FNULL, shell=False)
streamdata = sp.communicate()
if sp.returncode != 0:
labl6.config(text=f"Return code is {sp.returncode}")
break
labl6.config(text='Done')