Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107412
| From | Tim Golden <mail@timgolden.me.uk> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Running lpr on windows from python |
| Date | 2016-04-20 15:08 +0100 |
| Message-ID | <mailman.27.1461161336.12923.python-list@python.org> (permalink) |
| References | <7ec37d41-61eb-4c93-ae21-28d108c261f1@googlegroups.com> <57178D71.5050408@timgolden.me.uk> |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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