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


Groups > comp.lang.python > #92999

Re: Opening PDF Using subprocess.Popen Failing

From Robin Becker <robin@reportlab.com>
Subject Re: Opening PDF Using subprocess.Popen Failing
Date 2015-06-22 11:33 +0100
References <4857b9a4-386f-4ae4-861b-09a9564557c7@googlegroups.com> <7710dd71-6f37-4d1b-b868-bc233d4da3b7@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.698.1434969239.13271.python-list@python.org> (permalink)

Show all headers | View raw


.....

Naftali,

I ran the following from python prompt


import os
os.system('"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /n 
thello.pdf')


and this worked as did

import subprocess
subprocess.Popen(['C:\Program Files (x86)\Adobe\Reader 
11.0\Reader\AcroRd32.exe','/n','thello.pdf'])

however I also tried running

import subprocess
subprocess.Popen('AcroRd32.exe /nthello.pdf')

which seems closer to your

> new_command_str = "AcroRd32.exe /n" + outputname
> subprocess.Popen(new_command_str)

and that fails; the python error is


> C:\Users\rptlab\tmp>tpdf.py
> Traceback (most recent call last):
>   File "C:\Users\rptlab\tmp\tpdf.py", line 6, in <module>
>     subprocess.Popen('AcroRd32.exe /nthello.pdf')
>   File "c:\python27\lib\subprocess.py", line 710, in __init__
>     errread, errwrite)
>   File "c:\python27\lib\subprocess.py", line 958, in _execute_child
>     startupinfo)
> WindowsError: [Error 2] The system cannot find the file specified



-- 
Robin Becker

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


Thread

Opening PDF Using subprocess.Popen Failing Naftali <nmichalowsky@gmail.com> - 2015-06-19 10:24 -0700
  Re: Opening PDF Using subprocess.Popen Failing Laura Creighton <lac@openend.se> - 2015-06-19 20:17 +0200
  Re: Opening PDF Using subprocess.Popen Failing Naftali <nmichalowsky@gmail.com> - 2015-06-19 11:45 -0700
  Re: Opening PDF Using subprocess.Popen Failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-06-20 09:50 -0400
  Re: Opening PDF Using subprocess.Popen Failing Naftali <nmichalowsky@gmail.com> - 2015-06-20 20:14 -0700
    Re: Opening PDF Using subprocess.Popen Failing Robin Becker <robin@reportlab.com> - 2015-06-22 11:33 +0100
    Re: Opening PDF Using subprocess.Popen Failing Robin Becker <robin@reportlab.com> - 2015-06-22 11:55 +0100
  Re: Opening PDF Using subprocess.Popen Failing Naftali <nmichalowsky@gmail.com> - 2015-06-22 06:15 -0700
    Re: Opening PDF Using subprocess.Popen Failing Laura Creighton <lac@openend.se> - 2015-06-22 15:37 +0200
  Re: Opening PDF Using subprocess.Popen Failing Naftali <nmichalowsky@gmail.com> - 2015-06-22 07:23 -0700
  Re: Opening PDF Using subprocess.Popen Failing Naftali <nmichalowsky@gmail.com> - 2015-06-22 09:13 -0700

csiph-web