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


Groups > comp.lang.python > #93048

Re: Python File as the Default PDF handler for Windows

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.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.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'subject:Python': 0.05; '(so': 0.07; 'executable': 0.07; 'subject:Windows': 0.09; 'interpreter,': 0.09; 'path.': 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; 'itself.': 0.11; 'skip:p 40': 0.15; '"file': 0.16; '.py': 0.16; '>in': 0.16; 'chris,': 0.16; 'executable.': 0.16; 'message- id:@4ax.com': 0.16; 'placeholder': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:> 20': 0.16; 'subject:File': 0.16; 'url:home': 0.18; 'windows': 0.20; '+0200': 0.20; 'extension': 0.20; 'arguments': 0.22; 'install,': 0.22; '2015': 0.23; "i've": 0.24; 'script': 0.25; 'header:X-Complaints- To:1': 0.26; 'specify': 0.27; 'complain': 0.29; 'correct,': 0.29; 'itself,': 0.29; '(c)': 0.29; 'probably': 0.32; 'skip:. 10': 0.32; '2009': 0.34; 'file': 0.34; 'add': 0.34; 'skip:c 30': 0.35; 'to:addr:python-list': 0.35; 'path': 0.35; 'but': 0.36; 'two': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'pdf': 0.37; 'tue,': 0.38; 'received:org': 0.38; 'names': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'subject:the': 0.40; 'expert': 0.63; 'different': 0.64; 'reserved.': 0.70; 'clicking': 0.75; 'dennis': 0.91; 'panel.': 0.93; 'received:108': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Python File as the Default PDF handler for Windows
Date Tue, 23 Jun 2015 16:12:28 -0400
Organization IISS Elusive Unicorn
References <2bba2e7f-ef41-4b08-8768-fa154c219042@googlegroups.com> <863086551.5226529.1435069587998.JavaMail.root@sequans.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-108-79-222-44.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 6.00/32.1186
X-No-Archive YES
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.734.1435090373.13271.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1435090373 news.xs4all.nl 2907 [2001:888:2000:d::a6]:58884
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 4551
X-Received-Body-CRC 3489597688
Xref csiph.com comp.lang.python:93048

Show key headers only | View raw


On Tue, 23 Jun 2015 16:26:28 +0200 (CEST), Jean-Michel Pichavant
<jeanmichel@sequans.com> declaimed the following:

>> Just to update, you are correct, Chris, the file short name is passed
>> into sys.argv. didn't need to add anything to the path. But a gotcha
>> -- Windows didn't like my .py, clicking on the pdf causes Windows to
>> complain about 'file x' is not a valid windows executable. 
>
>I'm not an expert of windows but you probably need to specify the python interpreter, not the script itself.
>
>something like
>
>C:\Python2.7\python.exe yourscript.py %*
>
>in the windows file association panel.
>
	Need to check the specific install, I've seen two or three different
assoc names used in the past...

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Wulfraed\Documents>assoc .py
.py=Python.File

C:\Users\Wulfraed\Documents>ftype python.file
python.file="C:\Python_x64\Python27\python.exe" "%1" %*

	ftype links a "file type" handler to the executable path (note the "%1"
is the placeholder for the script name itself, and arguments to the script
are collected with %*). Assoc then links the extension to the handler (so
you can also assoc .pyc files to the same interpreter).
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Python File as the Default PDF handler for Windows Naftali <nmichalowsky@gmail.com> - 2015-06-18 14:04 -0700
  Re: Python File as the Default PDF handler for Windows Chris Angelico <rosuav@gmail.com> - 2015-06-19 09:46 +1000
  Re: Python File as the Default PDF handler for Windows Naftali <nmichalowsky@gmail.com> - 2015-06-18 18:03 -0700
    Re: Python File as the Default PDF handler for Windows Chris Angelico <rosuav@gmail.com> - 2015-06-19 11:18 +1000
    Re: Python File as the Default PDF handler for Windows MRAB <python@mrabarnett.plus.com> - 2015-06-19 02:39 +0100
    Re: Python File as the Default PDF handler for Windows Chris Angelico <rosuav@gmail.com> - 2015-06-19 11:46 +1000
  Re: Python File as the Default PDF handler for Windows Naftali <nmichalowsky@gmail.com> - 2015-06-18 18:22 -0700
  Re: Python File as the Default PDF handler for Windows Naftali <nmichalowsky@gmail.com> - 2015-06-23 06:39 -0700
    Re: Python File as the Default PDF handler for Windows Chris Angelico <rosuav@gmail.com> - 2015-06-24 01:00 +1000
    Re: Python File as the Default PDF handler for Windows Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-06-23 16:12 -0400
    Re: Python File as the Default PDF handler for Windows Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-23 21:20 +0100

csiph-web