Opening a file with Python

Kevin Riggle vj$ri^gg#guess#l55e at mt$*guess#&cn1e#t.!
Tue Jul 24 11:45:42 EDT 2001


Sorry about that...  I think this should work.

"c:\Program Files\WinPy\winpy.exe" "c:\Program Files\MyPyProg\mypyprog.py"
"%1"

If that doesn't work, you might try it without the double-quotes on the %1.
The quotes tell Windows to ignore spaces in a path (ie. 'Program _ Files')
and take everything they contain as one unit.  Otherwise Windows/DOS will
spit back 'Cannot find c:\Program' or something to that effect.

Best of luck...  Kevin


"Janos Blazi" <jblazi at hotmail.com> wrote in message
news:3b5d8947_5 at news.newsgroups.com...
> Thx.
> Most unfortunately, this does not work. If I omit the double quotes it
seems
> that the file is not opened correctly (I am usinf pythonw.exe instead of
> winpy.exe as i do not have the latter). If I set the double quotes, I
cannot
> enter my program as i get the error message 'the application you have
> selected does not exist'.
>
> Janos Blazi
>
> "Kevin Riggle" <vj$ri^gg#guess#l55e at mt$*guess#&cn1e#t.!@n()et> schrieb im
> Newsbeitrag news:9jhgm4$2mo$1 at mtc1.mtcnet.net...
> > You have to associate the file-type with the program.
> >
> > Open up My Computer, click View...Folder Options, select the File Types
> tab,
> > and click on New Type.
> >
> > Fill in the description and extension you want to use, then click on the
> New
> > button beneath the Actions: list box.
> >
> > Fill in the Action Name (probably Open), and set 'Application used to
> > perform action:' to
> >
> > "c:\Program Files\MyPyProg\mypyprog.exe %1" if using py2exe,
> >
> > or "c:\Program Files\WinPy\winpy.exe c:\Program
Files\MyPyProg\mypyprog.py
> > %1",
> >
> > in both examples *including* the double-quotes.
> >
> > (I haven't actually used Python on Windows, so if the WinPy path is a
> little
> > off please forgive me.)
> >
> > Hope this helps...  Kevin
> >
> >
> > "Janos Blazi" <jblazi at hotmail.com> wrote in message
> > news:3b5be641_3 at news.newsgroups.com...
> > > I'd like to write a Python program that starts when the user double
> clicks
> > > on a file name (in Win2K). I should be able to read the name of the
> file.
> > > What have I to do?
> > > This question has probably been asked many times, sorry.
> > >
> > > Janos Blazi





More information about the Python-list mailing list