1. PyPA
  2. Python Packaging Authority Projects
  3. pylauncher
  4. Issues
Issue #19 resolved

How to verify that Python Launcher is active

Henrik Holmboe
created an issue

I am trying to determine if the Python Launcher is active on my system. I have both Python 2.7.3 and 3.3.0 installed.

My first though was to check the file associations. So I ran assoc .py and then ftype Python.File. This returns a line that executes "~0,-1\Scripts\python.bat" and that seems wrong to me.

I turn to google and find https://bitbucket.org/vinay.sajip/pylauncher/src/tip/Doc/launcher.rst.

So, the issue is that I would like you to include the output of ftype Python.File from a correct installation of Python Launcher in https://bitbucket.org/vinay.sajip/pylauncher/src/tip/Doc/launcher.rst#from-file-associations.

Comments (6)

  1. Henrik Holmboe reporter

    I just noticed that ftype Python.NoConFile executes "C:\windows\pyw.exe" "%1" %* which seems more correct. It is strange that I have different settings for .py and .pyw, which probably have been set by the installers. (I don't recall which order or what settings I used during installation).

    PS. For completeness, to avoid confusion, the ftype Python.File returned "~0,-1\Scripts\python.bat" "%1" %*.

  2. Vinay Sajip

    I don't know if this can be fixed, because ftype and assoc don't always work. For example, on my Windows 7 (64-bit) system, I have the launcher installed, and the registry associations are correct (under both HKLM and HKCU). Yet, I don't get any useful output from ftype:

    C:\Users\Vinay>ftype .py
    File type '.py' not found or no open command associated with it.
    
    C:\Users\Vinay>ftype .pyc
    File type '.pyc' not found or no open command associated with it.
    

    Nor do I fare any better with assoc:

    C:\Users\Vinay>assoc Python.File
    File association not found for extension Python.File
    
    C:\Users\Vinay>assoc Python.NoConFile
    File association not found for extension Python.NoConFile
    

    And yet:

    C:\Users\Vinay>\temp\showver
    3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)]
    ['C:\\temp\\showver.py']
    
    C:\Users\Vinay>py -2 \temp\showver.py
    2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)]
    ['\\temp\\showver.py']
    
  3. Mark Hammond

    FWIW, I see:

    % ftype Python.file Python.file="C:\Windows\py.exe" "%1" %*

    which is what I expected to see :) "assoc" just maps the association to the class name - ie:

    % assoc .py .py=Python.File

  4. Log in to comment