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


Groups > comp.lang.python > #107491 > unrolled thread

Can't run lpr from python on windows 2012 server

Started byloial <jldunn2000@gmail.com>
First post2016-04-22 07:15 -0700
Last post2016-04-22 12:17 -0500
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Can't run lpr from python on windows 2012 server loial <jldunn2000@gmail.com> - 2016-04-22 07:15 -0700
    Re: Can't run lpr from python on windows 2012 server Random832 <random832@fastmail.com> - 2016-04-22 10:26 -0400
      Re: Can't run lpr from python on windows 2012 server loial <jldunn2000@gmail.com> - 2016-04-22 08:06 -0700
        Re: Can't run lpr from python on windows 2012 server Random832 <random832@fastmail.com> - 2016-04-22 12:02 -0400
    Re: Can't run lpr from python on windows 2012 server eryk sun <eryksun@gmail.com> - 2016-04-22 12:17 -0500

#107491 — Can't run lpr from python on windows 2012 server

Fromloial <jldunn2000@gmail.com>
Date2016-04-22 07:15 -0700
SubjectCan't run lpr from python on windows 2012 server
Message-ID<e3eb5715-8d3b-41ff-8690-4457bc02c426@googlegroups.com>
I am reposting this question in a simpler form.

I can run lpr from the command prompt but not from python

os.system("notepad") works
os.system("lpr") does not work. Basically it says lpr is not a known program or executable

Why can I run lpr from the windows command prompt but not from python(2.7)

[toc] | [next] | [standalone]


#107492

FromRandom832 <random832@fastmail.com>
Date2016-04-22 10:26 -0400
Message-ID<mailman.15.1461335217.2861.python-list@python.org>
In reply to#107491
On Fri, Apr 22, 2016, at 10:15, loial wrote:
> I am reposting this question in a simpler form.
> 
> I can run lpr from the command prompt but not from python
> 
> os.system("notepad") works
> os.system("lpr") does not work. Basically it says lpr is not a known
> program or executable
> 
> Why can I run lpr from the windows command prompt but not from
> python(2.7)

Does lpr.exe actually physically exist in c:\windows\system32 as you
have indicated in the your earlier posts? I.e. if you actually browse
system32 with the file manager will you see lpr.exe? The problem with
your question is that it's not a standard command, so none of the rest
of us have it, which means we're half-blind trying to find your problem.

[toc] | [prev] | [next] | [standalone]


#107495

Fromloial <jldunn2000@gmail.com>
Date2016-04-22 08:06 -0700
Message-ID<be0f43c0-4407-4d95-8476-004398f58cd4@googlegroups.com>
In reply to#107492
Yes it does. I finally found the solution here :

http://www.tomshardware.co.uk/forum/240019-44-error-windows

Copied lpr.exe, lprhelp.dll, and lprmonui.dll from the System32 folder to the sysWOW64 folder




On Friday, April 22, 2016 at 3:27:18 PM UTC+1, Random832 wrote:
> On Fri, Apr 22, 2016, at 10:15, loial wrote:
> > I am reposting this question in a simpler form.
> > 
> > I can run lpr from the command prompt but not from python
> > 
> > os.system("notepad") works
> > os.system("lpr") does not work. Basically it says lpr is not a known
> > program or executable
> > 
> > Why can I run lpr from the windows command prompt but not from
> > python(2.7)
> 
> Does lpr.exe actually physically exist in c:\windows\system32 as you
> have indicated in the your earlier posts? I.e. if you actually browse
> system32 with the file manager will you see lpr.exe? The problem with
> your question is that it's not a standard command, so none of the rest
> of us have it, which means we're half-blind trying to find your problem.

[toc] | [prev] | [next] | [standalone]


#107498

FromRandom832 <random832@fastmail.com>
Date2016-04-22 12:02 -0400
Message-ID<mailman.17.1461340982.2861.python-list@python.org>
In reply to#107495
On Fri, Apr 22, 2016, at 11:06, loial wrote:
> Yes it does. I finally found the solution here :
> 
> http://www.tomshardware.co.uk/forum/240019-44-error-windows
> 
> Copied lpr.exe, lprhelp.dll, and lprmonui.dll from the System32 folder to
> the sysWOW64 folder

A better solution might be to install a 64-bit version of Python.

[toc] | [prev] | [next] | [standalone]


#107502

Fromeryk sun <eryksun@gmail.com>
Date2016-04-22 12:17 -0500
Message-ID<mailman.20.1461345477.2861.python-list@python.org>
In reply to#107491
On Fri, Apr 22, 2016 at 9:26 AM, Random832 <random832@fastmail.com> wrote:
> The problem with your question is that it's not a standard command, so none
> of the rest of us have it, which means we're half-blind trying to find your problem.

lpr is a Windows feature that you may be able to enable. It's under
"Print and Document Services" -> "LPR Port Monitor". It only installs
a 64-bit build, which is why loial is having trouble running it from
32-bit Python. But in Windows 7+ (Server 2008 R2), a 32-bit process
can use the virtual "%SystemRoot%\SysNative" directory to access files
in the native System32 directory. I can run lpr.exe from 32-bit Python
using this method.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web