Running the python script without the opening of slicer window

I need to get output in my own developed UI not in the Slicer. Can you please help me with this ?

For a while we experimented with replacing the Slicer main window with our own widget, but later we figured it is much better for many reasons to customize the main window instead (hide what we don’t need, add any custom widgets, toolbars, menus, etc. that we need).

See this page for more information and examples.