Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'path.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:mac': 0.09; 'suggest': 0.15; 'apps': 0.15; '"information': 0.16; 'already,': 0.16; 'goal,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:n 50': 0.16; 'subject:already': 0.16; 'subject:instance': 0.16; 'there?': 0.16; 'url:documentation': 0.16; 'url:general': 0.16; 'wrote:': 0.16; 'app': 0.16; 'looked': 0.16; 'instance,': 0.18; 'script.': 0.18; 'prevent': 0.20; 'trying': 0.22; '(by': 0.22; 'tkinter': 0.22; "haven't": 0.24; 'header:User-Agent:1': 0.26; 'question': 0.26; 'header:X-Complaints-To:1': 0.26; 'guess': 0.29; 'certain': 0.31; 'problem': 0.33; 'usually': 0.33; 'instances': 0.33; 'running': 0.34; 'useful': 0.35; 'wrong': 0.35; 'to:addr:python-list': 0.35; 'clear': 0.35; 'i.e.': 0.35; 'instance': 0.35; 'really': 0.35; 'list': 0.35; 'but': 0.36; 'there': 0.36; '(and': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'rather': 0.38; 'received:org': 0.38; 'someone': 0.38; 'end': 0.39; 'to:addr:python.org': 0.39; 'sure': 0.40; 'some': 0.40; 'your': 0.60; 'hope': 0.61; 'identify': 0.61; 'taking': 0.62; 'more': 0.62; 'complete': 0.63; 'goal': 0.64; 'received:204': 0.75; 'url:i': 0.77; 'article': 0.77; 'alright,': 0.84; 'url:reference': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Deily Subject: Re: Detect if specific Python.app instance is already running Date: Sun, 07 Jun 2015 16:07:46 -0700 References: <11e093d5-b78e-4ac6-9a7f-649cb2c2c942@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 204.28.118.160 User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433718479 news.xs4all.nl 2970 [2001:888:2000:d::a6]:42036 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92312 In article <11e093d5-b78e-4ac6-9a7f-649cb2c2c942@googlegroups.com>, Andrei wrote: > Alright, I have had some development in > http://stackoverflow.com/questions/30694560/detect-if-specific-python-app-inst > ance-is-already-running and can prevent running multiple instances of the > same app/script (by lockf), but I still need to identify which Python.app > instance is running certain script. I guess it's more Cocoa-related question > but I hope someone had same problem with tkinter etc. Can you give a more complete explanation of the goal, i.e. what you are trying to end up with here, rather than the steps you are taking to get there? It's not at all clear to me what your goal is and the cumbersome steps you find you have to take suggest that you might be going down the wrong path. OS X apps usually don't have to resort to such hacks. If you haven't already, make sure you have looked at the "Information Property List Key Reference" for OS X (and iOS) apps. For instance, key LSMultipleInstancesProhibited *might* be useful if you really only want to ensure that there is only instance of an app launched. https://developer.apple.com/library/mac/documentation/General/Reference/I nfoPlistKeyReference/Articles/LaunchServicesKeys.html -- Ned Deily, nad@acm.org