Python - Disable multiple py script instances and pass their args to main instance -
for illustration py script has 1 instance running , when fire instance args, instead of allowing new instance run, create pass args main instance or create main instance awares of args can whatever needs args. possible?
it possible not trivial because processes unrelated. have set :
an exclusion mechanism (file lock should portable across architectures) allow process know if first - beware of race status when server exit when new process arrives ... the first process opens listener - socket on unused port should portable you must define protocol allow processes communicate on socket when process discovers not first, contacts first on socket , passes argumentsso can work, lot of work ...
there solutions little simpler if can limit specific architectur (only windows or linux) , create utilize of specific libraries, nether simple job.
python python-2.7
No comments:
Post a Comment