Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; '*not*': 0.07; 'subject:Windows': 0.09; '"%s"': 0.09; 'extension.': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'definition.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'looping': 0.16; 'subject:File': 0.16; 'wrote:': 0.16; 'windows': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'do.': 0.22; 'am,': 0.23; '2015': 0.23; 'passing': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'wondering': 0.25; 'message-id:@mail.gmail.com': 0.28; 'there.': 0.30; '---': 0.30; 'fri,': 0.31; 'maybe': 0.31; 'run': 0.32; 'file': 0.34; 'add': 0.34; 'received:google.com': 0.34; "i'll": 0.34; 'path': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.37; 'subject:: ': 0.37; 'missing': 0.37; 'doing': 0.38; 'end': 0.39; 'subject:the': 0.40; 'called': 0.40; 'your': 0.60; 'simple': 0.61; 'within': 0.64; 'chrisa': 0.84; 'tomorrow,': 0.84; 'to:none': 0.90; 'mean.': 0.91; 'reply,': 0.93 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:content-transfer-encoding; bh=dPdhjbF7Ci4BiVfUIMmN/+OxcwQJGI40dwqhfdgVY5g=; b=W9ML4Jy2lhAMQKi/mJCUEXZDOPy997m9CnxXMN2iPn3QcX1kxmziPdK2uskVu0D6uj YjF/T1trnzqvbp/pyMs83GMeqeBR+sR6zkPcorRcdH4bWwqqzBbLWfPMBeiza0deTGeW koHM4UBOKRVvVjipMcc+wXjlz9z1zdsrRXZXQADCt2Cj4LNGVYv0M2y5SDTkuIrLfw1F hkq+zCPkR5cwWNzOENK8ZCSgPgnyLK5kBdb6d35OkpA+1K/tLU9jEHhtFlnBLzWlNrt7 0PWajyWcBe2GnP0H+Etu1sg5bMEWolfmyh4OMcoi0m/Qcau2BMf6kmevwRcQbQ6XPSrx JZBQ== MIME-Version: 1.0 X-Received: by 10.43.0.67 with SMTP id nl3mr8799288icb.59.1434676690582; Thu, 18 Jun 2015 18:18:10 -0700 (PDT) In-Reply-To: References: <60c5531e-b4b4-43b2-a3b9-0b53e1490dee@googlegroups.com> Date: Fri, 19 Jun 2015 11:18: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 Content-Transfer-Encoding: quoted-printable 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434676699 news.xs4all.nl 2848 [2001:888:2000:d::a6]:33632 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4219 X-Received-Body-CRC: 4007776081 Xref: csiph.com comp.lang.python:92864 On Fri, Jun 19, 2015 at 11:03 AM, Naftali wrote: > I may be missing something in your reply, but I am *not* wondering how to= associate python with the .pdf file extension. That I know how to do. What= I want to know is how from within the program that I've told windows to ru= n when the user clicks on the file --- how to access the file that the user= wishes to open. Windows must somehow make that available to my program. Ho= w to I access it. Tomorrow, I'll try doing it an looping through the sys.ar= gvs and see what's there. maybe it's a simple as passing a path into the ca= lled program. > Oh! I see what you mean. You should get the full path and name of the file in sys.argv, but if you don't, I think what you need to do is add "%s" to the end of the association definition. My apologies for the prior misunderstanding. ChrisA