Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: eryk sun Newsgroups: comp.lang.python Subject: Re: Running lpr on windows from python Date: Wed, 20 Apr 2016 22:10:47 -0500 Lines: 11 Message-ID: References: <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com> <7a7e2d01-fcf3-4f14-9531-f19a96700cf3@googlegroups.com> <5717991E.70309@timgolden.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de WEUOaZW1XykysqJFou8+IAv0npRsWM6oCX0/9dtFIj7g== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'received:209.85.223': 0.03; 'subject:python': 0.14; 'wed,': 0.15; '2016': 0.16; 'access).': 0.16; 'accesses': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:windows': 0.16; 'wrote:': 0.16; 'windows': 0.20; 'not,': 0.22; '64-bit': 0.22; 'am,': 0.23; '(or': 0.23; 'tim': 0.24; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'received:google.com': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'virtual': 0.38; 'received:209': 0.38; 'skip:p 20': 0.38; 'copying': 0.38; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; '20,': 0.66; 'directory:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=h90rnryqXl2XienHvZ1qNGScN/eh2yvnS8wUy4Fe++Q=; b=NBsKoIO46tc3RdIXk6GZH0V4pE7wwi0nXPNNgxblqeeGYLVdqO0XnDwBWJzSI36U5F k3+NTP7XAXOuxqvOFAixpWLCdJKX0NVbmY7Np/NDFJ7Ym28DjNamPUpIk2h7PNEmE+PE 2tIFXqNv+nVUHwQIIqAu+Rkjg9tiLD5Ln3iT2A8u/z4smu/4ZOmRELjcp3xYSJANJ+NN pnttgrd3wieJ5zBxU2LIab6jjKu9pGdUEeMLUUf15yz61YvYPJ7ytX0Lik/V/nmtVJnT 8YFZEdywateZlUscTNj2GsE03ovR4RX49NpodgKQXgTfNF9loXLoaX63S22MS5lKjqvT 1hzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=h90rnryqXl2XienHvZ1qNGScN/eh2yvnS8wUy4Fe++Q=; b=Br7ZrBCIQMoX2d7EwYW7lB7EQvkjdLn5TQpKA8vP4MPltHAir2b7oTW8wLbOuH/aMN KoSTWE7MCSd47vF24BMsWPpzyOsKv5rA3/aCD/Mlqx0yLwHByE5ryXsai92qZMTnICmo HCWCdhkrncvImFZWBqcAa01M1aZYjruzBxmeykd+rVOL//BLPPeqLzaM4lrbR1DY12vR Q8JfxYInUd4nIxqa217yLUd6E3MYGBcIvymT04ZX5TvBey/QC1JfqVnFmITvybBZj5u6 Q54xawBE7qIFu7fvreFHDUgrF1yaitgktm/Ii0QuzV8On45vvy4LkTchDOtQQPOpAbG5 cZBA== X-Gm-Message-State: AOPr4FWSKizncjSZQLKUrG+JYBqaYvAFcQWyPvhPlvNlO0+NKRShkexs7NhBLeB9JJxQmhOiPmpws4KGeWoNxA== X-Received: by 10.107.10.87 with SMTP id u84mr13603803ioi.188.1461208286999; Wed, 20 Apr 2016 20:11:26 -0700 (PDT) In-Reply-To: <5717991E.70309@timgolden.me.uk> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com> <7a7e2d01-fcf3-4f14-9531-f19a96700cf3@googlegroups.com> <5717991E.70309@timgolden.me.uk> Xref: csiph.com comp.lang.python:107433 On Wed, Apr 20, 2016 at 9:58 AM, Tim Golden wrote: > If it's not, then try copying the lpr.exe to c:\windows\syswow64 and try > again. (Or to some other place to which you have access). WOW64 in Windows 7+ has a virtual "SysNative" directory that accesses the native 64-bit system directory: if '32bit' in platform.architecture(): lpr = os.path.join(os.environ['SystemRoot'], 'SysNative', 'lpr.exe') else: lpr = os.path.join(os.environ['SystemRoot'], 'System32', 'lpr.exe')