Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:Windows': 0.02; 'scripts': 0.03; 'argument': 0.05; 'interpreter': 0.05; 'url:bitbucket': 0.05; 'subject:Python': 0.06; 'python3': 0.07; 'subject:installation': 0.07; 'advance': 0.07; 'executed': 0.09; 'subject:script': 0.09; 'martin': 0.11; 'python': 0.11; 'bug': 0.12; 'gui': 0.12; 'windows': 0.15; 'system-wide': 0.16; 'url:virtualenv': 0.16; 'fix': 0.17; 'all,': 0.19; 'trying': 0.19; 'solution.': 0.20; 'starts': 0.20; 'written': 0.21; 'skip:` 20': 0.24; 'specify': 0.24; 'subject:problem': 0.24; 'environment': 0.24; 'source': 0.25; 'script': 0.25; 'class.': 0.26; 'header:In-Reply-To:1': 0.27; '[1]': 0.29; '[2]': 0.30; 'message-id:@mail.gmail.com': 0.30; 'along': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'usually': 0.31; 'file': 0.32; 'probably': 0.32; 'checked': 0.32; 'selection': 0.32; 'run': 0.32; 'url:python': 0.33; 'subject:from': 0.34; 'subject: (': 0.35; 'except': 0.35; 'case,': 0.35; 'requirement': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'possible': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'should': 0.36; 'project': 0.37; 'solving': 0.38; 'version,': 0.38; 'to:addr:python-list': 0.38; 'launch': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'commands': 0.60; 'different': 0.65; 'success,': 0.65; 'installer': 0.84; 'url:latest': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=0uXnAZQFsCJtKuPfLrqAxMICCW2vntxPZlibKodfFXM=; b=f5GqimOio1cfHLvYS4S8LUfGi8WvMwfOx2X6MM3awYfL1N2KEtnOtS35qt3/T8SuOG WvZN4uz39KwevxpHwhq51J/lrvrdTsk+OeXn9m+8eVcMxavFvtFswsFU0EDAwQk2O7mt lkGcJaqZcx9PRXF5KdFFQoF0AVIMmEngXn/jcp2X35kATYmI97LPduoPQfVl6sGiREYY n8gRn57ASbLpLfR8cnLha1e5EBIuXq3GSyengp4tWyJM4DUzdzT0A0kvPNCgk9GD//Wz yfyza3pAQyWb1l9pNEuZfFliOyyB1jfaUX7L5xBr1HnvaY2WE3eRPHSoP9oL+23WsWlu z2OA== MIME-Version: 1.0 X-Received: by 10.140.92.137 with SMTP id b9mr4835502qge.41.1395834047195; Wed, 26 Mar 2014 04:40:47 -0700 (PDT) In-Reply-To: <4b100198-73d0-4562-89cf-8af9b9b87174@googlegroups.com> References: <4b100198-73d0-4562-89cf-8af9b9b87174@googlegroups.com> Date: Wed, 26 Mar 2014 12:40:47 +0100 Subject: Re: calling Python script from another Python script (Windows, multiple installation problem) From: Vlastimil Brom To: python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395834055 news.xs4all.nl 2873 [2001:888:2000:d::a6]:36418 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69115 2014-03-26 10:40 GMT+01:00 Martin Landa : > Hi all, > > I am trying to fix a bug in the project which I am working for. The progr= am starts on Windows via bat file which calls a Python script to set up the= environment including GUI and allow to launch program-specific tools. Some= of the tools are written in C, some in Python. These commands are run via = subprocess.Popen class. The Windows installer comes with its own bundled Py= thon which is usually different from possible system-wide Python. This is s= ource of the problems, Python scripts run via subprocess.Popen are launched= via system-wide Python version, not desired bundled Python. Except hacks l= ike `Popen(sys.executable, ...)` I am looking for a better solution. I chec= ked virtualenv [1] or Pylauncher [2] but without success, speaking about Py= thon2 not Python3 which comes from version 3.3 with intergrated pylauncher.= .. > > Thanks in advance for any ideas, suggestions or pointers! Martin > > [1] http://www.virtualenv.org/en/latest/ > [2] https://bitbucket.org/vinay.sajip/pylauncher > -- > https://mail.python.org/mailman/listinfo/python-list Hi, I'm probably missing some requirement of your use case, but I guess, it should be possible to specify the path of the desired python interpreter along with the executed script as an argument to Popen(...). This should make the selection of the used python explicit. Or are there any other disadvantages of the current approach, which you are solving in parallel? hth, vbr