Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107412

Re: Running lpr on windows from python

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Tim Golden <mail@timgolden.me.uk>
Newsgroups comp.lang.python
Subject Re: Running lpr on windows from python
Date Wed, 20 Apr 2016 15:08:49 +0100
Lines 36
Message-ID <mailman.27.1461161336.12923.python-list@python.org> (permalink)
References <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com> <57178D71.5050408@timgolden.me.uk>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de loBHfN4ZV+bWesxHlLLpSgxzHTs2WgYhgAT9x4gapk7w==
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pipermail': 0.05; 'type:': 0.09; 'example:': 0.10; 'python': 0.10; 'assume': 0.11; 'subject:python': 0.14; 'also:': 0.16; 'command,': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'subject:windows': 0.16; 'subprocess': 0.16; 'tjg': 0.16; 'wrote:': 0.16; 'typing': 0.18; 'windows': 0.20; '64-bit': 0.22; 'file.': 0.22; 'trying': 0.22; 'recognized': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'command': 0.26; 'external': 0.27; 'error': 0.27; 'raw': 0.27; 'follows': 0.29; 'path,': 0.29; 'system?': 0.29; 'probably': 0.31; 'run': 0.33; 'url:python': 0.33; 'windows.': 0.33; "skip:' 20": 0.34; 'so,': 0.35; 'dir': 0.35; "isn't": 0.35; 'but': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'subject:from': 0.39; 'received:192': 0.39; 'rather': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'where': 0.40; 'called': 0.40; 'charset:windows-1252': 0.62; 'is.': 0.63; 'from:addr:mail': 0.70; 'prompt': 0.79; 'location?': 0.84
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1
In-Reply-To <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <57178D71.5050408@timgolden.me.uk>
X-Mailman-Original-References <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com>
Xref csiph.com comp.lang.python:107412

Show key headers only | View raw


On 20/04/2016 14:57, loial wrote:
> I am trying to run lpr from python 2.7.10 on windows
> 
> However I always get the error
> 'C:/windows/system32/lpr.exe ' is not recognized as an internal or external command,
> operable program or batch file.
> 
> Even though typing the same at the  command prompt works OK
> 
> 
> Any ideas?
> 
> I am using subprocess as follows
> 
> process = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> 
> where command line is
> C:/windows/system32/lpr.exe -S 172.28.84.38 -P RAW C:/john/myfile
> 

Ummm.. Do you actually have a program called lpr.exe in that location?
It's not usual on Windows. (I rather assume you do since you give the
full path, but still...)

IOW, what happens if you type:

  dir C:\windows\system32\lpr.exe

at a command promopt?

Also: are you on a 64-bit system? If so, c:\windows\system32 probably
isn't where you think it is. cf, for example:

  https://mail.python.org/pipermail/python-win32/2012-March/012121.html

TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Running lpr on windows from python loial <jldunn2000@gmail.com> - 2016-04-20 06:57 -0700
  Re: Running lpr on windows from python Chris Angelico <rosuav@gmail.com> - 2016-04-21 00:07 +1000
    Re: Running lpr on windows from python loial <jldunn2000@gmail.com> - 2016-04-20 07:25 -0700
  Re: Running lpr on windows from python Tim Golden <mail@timgolden.me.uk> - 2016-04-20 15:08 +0100
  Re: Running lpr on windows from python Random832 <random832@fastmail.com> - 2016-04-20 10:09 -0400
  Re: Running lpr on windows from python loial <jldunn2000@gmail.com> - 2016-04-20 07:21 -0700
    Re: Running lpr on windows from python Tim Golden <mail@timgolden.me.uk> - 2016-04-20 15:58 +0100
    Re: Running lpr on windows from python eryk sun <eryksun@gmail.com> - 2016-04-20 22:10 -0500
  Re: Running lpr on windows from python Stephen Hansen <me+python@ixokai.io> - 2016-04-20 14:01 -0700
  Re: Running lpr on windows from python loial <jldunn2000@gmail.com> - 2016-04-22 04:30 -0700
    Re: Running lpr on windows from python loial <jldunn2000@gmail.com> - 2016-04-22 08:07 -0700
      Re: Running lpr on windows from python eryk sun <eryksun@gmail.com> - 2016-04-22 12:04 -0500

csiph-web