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


Groups > comp.lang.python > #92866

Re: Python File as the Default PDF handler for Windows

Date 2015-06-19 02:39 +0100
From MRAB <python@mrabarnett.plus.com>
Subject Re: Python File as the Default PDF handler for Windows
References <60c5531e-b4b4-43b2-a3b9-0b53e1490dee@googlegroups.com> <e97c8320-1085-46e1-b004-3b90e30d2e0b@googlegroups.com> <CAPTjJmpdh+c29rAHraSfVXKmR2WvM2mijpOQ=aaWP7ZibWxQLg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.622.1434678004.13271.python-list@python.org> (permalink)

Show all headers | View raw


On 2015-06-19 02:18, Chris Angelico wrote:
> On Fri, Jun 19, 2015 at 11:03 AM, Naftali <nmichalowsky@gmail.com> 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 run 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. How to I access it. Tomorrow, I'll try doing it an looping through the sys.argvs and see what's there. maybe it's a simple as passing a path into the called 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.
>
I don't think it should be "%s", but "%*".

This has more details:

https://technet.microsoft.com/en-us/library/bb490912.aspx

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