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


Groups > comp.lang.python > #92999

Re: Opening PDF Using subprocess.Popen Failing

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'subject:skip:s 10': 0.05; 'skip:/ 10': 0.07; '__init__': 0.09; 'errread,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'errwrite)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:1 40': 0.16; 'subject:Opening': 0.16; 'subprocess': 0.16; 'skip:" 30': 0.20; 'specified': 0.23; 'tried': 0.24; 'import': 0.24; 'seems': 0.24; 'header:In-Reply-To:1': 0.24; '(most': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'error': 0.27; 'closer': 0.29; 'skip:s 30': 0.31; 'worked': 0.31; 'skip:_ 10': 0.32; 'traceback': 0.33; 'running': 0.34; 'file': 0.34; 'to:addr :python-list': 0.35; 'skip:o 20': 0.35; 'subject:: ': 0.37; 'received:org': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'your': 0.60; 'skip:n 10': 0.63; 'received:109': 0.75; 'prompt': 0.79; '[error': 0.84; 'becker': 0.84; 'subject:Using': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Robin Becker <robin@reportlab.com>
Subject Re: Opening PDF Using subprocess.Popen Failing
Date Mon, 22 Jun 2015 11:33:47 +0100
References <4857b9a4-386f-4ae4-861b-09a9564557c7@googlegroups.com> <7710dd71-6f37-4d1b-b868-bc233d4da3b7@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 109.174.168.73
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To <7710dd71-6f37-4d1b-b868-bc233d4da3b7@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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>
Newsgroups comp.lang.python
Message-ID <mailman.698.1434969239.13271.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1434969239 news.xs4all.nl 2917 [2001:888:2000:d::a6]:43252
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:92999

Show key headers only | 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