Recommended way to run a fixed Python script/module in the background

As part of my plugin, I'd like to run a certain Python module as a background process - essentially the command `python -m module_name`. Running a static script would also do the trick. The plugin is for PyCharm or projects using the Python module.

Ideally I would like to:

  1. Use the current project interpreter to run the module/script
  2. Use PyCharm's method of automatically installing the package from PyPI if necessary
  3. Display a console log of the process (as in the Run tool window) in my own tool window content.

How would I do this with the help of existing code in the platform? What methods do I need to either call or copy?

2

Please sign in to leave a comment.