Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'from:addr:yahoo.co.uk': 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; 'chris,': 0.16; 'executable.': 0.16; 'placeholder': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:File': 0.16; 'wrote:': 0.16; 'language': 0.19; '>>>': 0.20; 'windows': 0.20; '+0200': 0.20; 'extension': 0.20; 'arguments': 0.22; 'install,': 0.22; 'lawrence': 0.22; '2015': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'header:User-Agent:1': 0.26; 'installed': 0.26; 'header:X -Complaints-To:1': 0.26; 'specify': 0.27; "i'm": 0.29; 'complain': 0.29; 'correct,': 0.29; 'itself,': 0.29; '(c)': 0.29; 'skip:p 30': 0.32; 'probably': 0.32; 'language.': 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; 'skip:. 20': 0.35; 'something': 0.35; 'but': 0.36; 'two': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'pdf': 0.37; 'tue,': 0.38; 'received:org': 0.38; 'names': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'mark': 0.40; 'subject:the': 0.40; "you've": 0.61; 'expert': 0.63; 'different': 0.64; 'our': 0.64; 'charset:windows-1252': 0.65; 'reserved.': 0.70; 'clicking': 0.75; '3.4': 0.84; 'pythonistas,': 0.84; 'dennis': 0.91; 'panel.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Python File as the Default PDF handler for Windows Date: Tue, 23 Jun 2015 21:20:21 +0100 References: <2bba2e7f-ef41-4b08-8768-fa154c219042@googlegroups.com> <863086551.5226529.1435069587998.JavaMail.root@sequans.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-146-7-216.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1435090836 news.xs4all.nl 2920 [2001:888:2000:d::a6]:34006 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93050 On 23/06/2015 21:12, Dennis Lee Bieber wrote: > On Tue, 23 Jun 2015 16:26:28 +0200 (CEST), Jean-Michel Pichavant > 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). > With Python 3.4 or if you've installed the pylauncher independantly. C:\Users\Mark\Documents\MyPython>assoc .py .py=Python.File C:\Users\Mark\Documents\MyPython>ftype python.file python.file="C:\Windows\py.exe" "%1" %* C:\Users\Mark\Documents\MyPython>assoc .pyw .pyw=Python.NoConFile C:\Users\Mark\Documents\MyPython>ftype python.noconfile python.noconfile="C:\Windows\pyw.exe" "%1" %* -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence