0

My problem is that I don't know how to release a resources using python.

I'm using Ubuntu Linux and trying to call some application, but when it is called, it doesn't release resources, it just hangs. I know about & but it gets passed as argument to application, it doesn't execute application in background.

My code:

import os, subprocess

path_to_app = os.path.join('/', 'usr', 'bin', 'firefox')

subprocess.Popen([path_to_app], '&')

print("Something..") # Hangs until app is closed

How to just run application and move on, without hanging ?

Dinko Pehar
  • 5,454
  • 4
  • 23
  • 57
  • Duplicate of : https://stackoverflow.com/questions/1196074/how-to-start-a-background-process-in-python , Hope it solves :) – Arbazz Hussain Nov 27 '18 at 16:01
  • Possible duplicate of [How to start a background process in Python?](https://stackoverflow.com/questions/1196074/how-to-start-a-background-process-in-python) – MaJoR Nov 27 '18 at 16:02

1 Answers1

0

I solved it somehow using:

subprocess.Popen([path_to_app], shell=True)

Dinko Pehar
  • 5,454
  • 4
  • 23
  • 57