Answer the question
In order to leave comments, you need to log in
How to create Singleton with process control?
there is a long process that only superuser has access to.
is launched in another thread, similar to the article .
how to make a singleton with the ability to control employment, that is, when accessing it, either a process is started, or a message is returned that the process is already running?
Answer the question
In order to leave comments, you need to log in
Singleton has nothing to do with it.
You need inter-process communication facilities.
from multiprocessing import Lock
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question