0

I have an application developed with python that makes a call to a subprocess.run(...) function when pushing a button in the interface:

subprocess.run(['java','-jar','myprogram.jar',testFile], capture_output=True)

This opens a temporary console that runs for a few seconds before closing itself.

Is there any way to avoid the console popping out?

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Angela
  • 51
  • 5
  • Is this on windows or mac? – whiplash Oct 18 '22 at 14:28
  • Does this answer your question? [How do I hide the console when I use os.system() or subprocess.call()?](https://stackoverflow.com/questions/7006238/how-do-i-hide-the-console-when-i-use-os-system-or-subprocess-call) – msamsami Oct 18 '22 at 14:28
  • 1
    If @msamsami 's link doesn't help, it could possibly be that the console is opened by the jar directly. Perhaps [this](https://stackoverflow.com/questions/5710839/start-a-java-program-without-the-console) could help you. – whiplash Oct 18 '22 at 14:32
  • @whisplash The jar was opening the console, so your last comment helped! Thanks! – Angela Oct 25 '22 at 10:12

0 Answers0