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


Groups > comp.lang.python > #107425

Re: Running lpr on windows from python

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Stephen Hansen <me+python@ixokai.io>
Newsgroups comp.lang.python
Subject Re: Running lpr on windows from python
Date Wed, 20 Apr 2016 14:01:59 -0700
Lines 17
Message-ID <mailman.40.1461186123.12923.python-list@python.org> (permalink)
References <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com> <1461186119.52599.584860929.759DC943@webmail.messagingengine.com>
Mime-Version 1.0
Content-Type text/plain
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de lGPLs/uYK0bTRIem9JoO3gd8ynuca7ZF7oFxBBIh1OZQ==
Return-Path <me+python@ixokai.io>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'line:': 0.07; 'received:internal': 0.09; 'subject:python': 0.14; 'wed,': 0.15; 'commandline': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'slashes.': 0.16; 'subject:windows': 0.16; 'wrote:': 0.16; 'string': 0.17; 'stephen': 0.22; 'am,': 0.23; 'header:In-Reply- To:1': 0.24; 'command': 0.26; 'raw': 0.27; '---': 0.28; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'front': 0.38; 'received:66': 0.38; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'header:Message-Id:1': 0.61; 'making': 0.62; '20,': 0.66
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=ixokai.io; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=lSW0tkYt0F/0OhqDKWX2POPkcyw=; b=qGlMPG 5z3jJ1g24kI0I3or5JTqpGlxYFCEOZB1Zzrs2/SsAHJzAVFnXByCQQckqvKTZenH wdeuVjMFoNz1SO0Z0t28SNdBJfzDNd8jOpjTXdt7jdTSZ0Rs4HxEJCg8ZkIFiF74 3lIlowESFVWGWIDNChSbzu4nd3TuXFHbhT9dg=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=lSW0tkYt0F/0Ohq DKWX2POPkcyw=; b=XWzqVVVDhjLnI71z1WHb2QkQGWl3WZQwkQLXvOygB+4L5En 8RSRLe4gsq3ox4OISi9TuGL5ztdkaJJtTiYGXpEoJ6fGe7RBGmSkKv2gSeWZ/rE8 p2skEPZD2ZT3nZVtyzkszqi7BZRC6OxKW7S13jgDJsFKxezAU6+8bJgxt/RQ=
X-Sasl-Enc L9Ph+QnfP1WeXGGdH5yyY7ErZvcyfz6iJc4AgKYHKikk 1461186119
X-Mailer MessagingEngine.com Webmail Interface - ajax-71fd8077
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 <1461186119.52599.584860929.759DC943@webmail.messagingengine.com>
X-Mailman-Original-References <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com>
Xref csiph.com comp.lang.python:107425

Show key headers only | View raw


On Wed, Apr 20, 2016, at 06:57 AM, loial wrote:
> 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

Try making command line:
commandline = r"C:\windows\system32\lpr.exe -S 172.28.84.38 -P RAW
C:\john\myfile"

The r in front of the string makes it a raw string so you don't have to
double up the slashes.

---
Stephen Hansen
  m e @ i x o k a i . i o

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