This was the piece of code I am referring to https://stackoverflow.com/a/73587858/10813659 in my previous StackOverflow post.
Running my Python code within the terminal does not keep opening and closing the window but it does when creating an exe with auto-py-exe with 'hide console window'. I was wondering if there is a way to suppress this behavior as it is very distracting when running my simple command while working.
Right now, keeping the application 'console based' suppresses this issue but as soon as I want to hide the console and go 'Window Based', the PowerShell command keeps opening and closing.
The piece of code in question:
import subprocess
p = subprocess.run(
["powershell.exe",
"-NoProfile",
"-ExecutionPolicy", "Bypass",
"-File", "C:/Users/xxxxx/Documents/betterNetstatOut.ps1"],
capture_output=True, text=True
)