Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'handler': 0.04; 'subject:Python': 0.05; 'executable': 0.07; 'subject:Windows': 0.09; 'instruction.': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'explicitly': 0.15; 'interpreter': 0.15; '"file': 0.16; 'binary.': 0.16; 'describing': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'googled': 0.16; 'subject:File': 0.16; 'unlocked': 0.16; 'wrote:': 0.16; 'gui': 0.18; 'versions': 0.20; 'windows': 0.20; '(or': 0.21; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'am,': 0.23; '2015': 0.23; "haven't": 0.24; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'updating': 0.27; 'message-id:@mail.gmail.com': 0.28; 'command': 0.28; 'fri,': 0.31; 'trouble': 0.31; 'run': 0.32; 'possibly': 0.32; 'getting': 0.33; 'open': 0.33; 'file': 0.34; 'received:google.com': 0.34; 'something': 0.35; "isn't": 0.35; 'handle': 0.36; 'but': 0.36; 'should': 0.37; 'subject:: ': 0.37; 'pdf': 0.37; 'subject:the': 0.40; 'your': 0.60; "you've": 0.61; 'different': 0.64; 'adobe': 0.66; 'internet': 0.69; 'chrisa': 0.84; 'to:none': 0.90 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=wuOit7ss/6lvRxzq3Ic5w3Gd2dkdqbv8kul71+Fo9Bg=; b=p4R0ITcNaBYZu/pt6UAkAXJfsAKoxHAxZGFN41aJHy7BFjHtOSd7s8ENtQMzMHc45M rVQCBhftI/n6xuVBWAbvHAP47dswc58XLhZ5x3+pvH8XbxYN0DmAinAeDnRyeET2J0Bb nrH7rjRZZyzsQzvZA8zCwhvjyf3bLZ5e55k7U90VToZ+UriGMwrsAs7QciPZA0E1Cs3+ e2ZVvGCmalarKE37WB/wqhpVdMfG3L3dh+DqrpgfRfdfIIVrZmdkMgBgb3KPCQAv6QiQ /thSOv2dJbetv0IWPHo16a5mspK5SioFm2utCxBB1G1SROlykKW2b6rMsL8HS93oAoFF o33g== MIME-Version: 1.0 X-Received: by 10.42.43.199 with SMTP id y7mr8661556ice.12.1434671170462; Thu, 18 Jun 2015 16:46:10 -0700 (PDT) In-Reply-To: <60c5531e-b4b4-43b2-a3b9-0b53e1490dee@googlegroups.com> References: <60c5531e-b4b4-43b2-a3b9-0b53e1490dee@googlegroups.com> Date: Fri, 19 Jun 2015 09:46:10 +1000 Subject: Re: Python File as the Default PDF handler for Windows From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434671173 news.xs4all.nl 2829 [2001:888:2000:d::a6]:45622 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4430 X-Received-Body-CRC: 2436881113 Xref: csiph.com comp.lang.python:92860 On Fri, Jun 19, 2015 at 7:04 AM, Naftali wrote: > What I want to do is write a pdf handler to handle windows open instruction. In the script I would run a command line pdf unlocker on the file and open the unlocked file with adobe (or the like). > > I've googled and though I get tons of 'how to open pdf from a python script' I haven't found anything describing how to write and set up my python program to deal with the pdf hand-off from the OS. > Possibly the reason you've found nothing is that this isn't actually a Python issue :) What you want to do is tell your OS that when you double-click on a PDF, it should run this program. That's better referred to as "file associations". Different versions of Windows put that in different places, but poke around in your GUI or on the internet and you should be able to find something on updating associations. If you're having trouble getting a Python program to run in that situation, it may help to explicitly name a Python interpreter - an executable binary. ChrisA