Open files with double click

Caution! What follows is Windows only!

(Even worse, it is only for the NT-based systems: NT/2K/XP/2003.)

It's in sys.argv. Here's the basic scheme.

   C:\Dev\usbio>assoc .py
   .py=Python.File
   
Does that command create an association or merely show you an
existing one?

That particular command only shows the existing association. The Python
installer for Windows creates associations for .py, .pyc, .pyo, and .pyw
extension.

However, you can add your own:

   assoc .tnr = Tims.Files

   C:\Dev\usbio>ftype python.file
   python.file=C:\Apps\Python23\python.exe "%1" %*
   
Same question.

    ftype Tims.Files=c:\apps\python23\python.exe
c:\bin\MyTnrFileHandler.py "%1" "%*"

You can also do all of that from the registry, but it's a pain in the butt.

But that doesn't really do what he OP asked. Let's say he
wants to run "myWxProgram.py" for all files with a suffix of
".foo". He'd have to do something like

C:\Dev\usbio>assoc .foo
.foo=Foo.File

C:\Dev\usbio>ftype foo.file
python.file=C:\Apps\Python23\python.exe C:\path\to\myWxProgram.py "%1" %*

[I don't really do windows, so I'm extrapolating based on the
assumption your basic methodology is correct.]

Your extrapolation engine is very good. That's the exact concept. The
only thing you didn't have was the command-line syntax, and I wouldn't
have expected you to know that unless you spend a lot of time in Windows
command-line shells.

···

On Thu, 10 Feb 2005 12:58:17 -0600, Grant Edwards <grante@visi.com> wrote:

On Thu, Feb 10, 2005 at 09:33:30AM -0800, Tim Roberts wrote:

--
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.