[PIPython] Aprire un file con applicazione di default

Gianluca Di Carlo gianluca
Ven 19 Nov 2004 15:16:44 CET


Sotto linux non esiste nessuna soluzione?

Gianluca

> > Salve,
> > sto creando un'applicazione con wxPython ed ho questo
> problema: l'utente
> > deve selezionare un file dal suo pc e poi aprirlo con
> l'applicazione di
> > default (esempio un .pdf con acrobat, un .doc con word).
> Come posso
> > fare?
> > 
> > Gianluca
> 
> su windoze (che assumo utilizzi dato che citi word):
> 
> import os
> os.startfile(path)
> 
> Start a file with its associated application. This acts like
> double-clicking the file in Windows Explorer, or giving the
> file name as an argument to the start command from the
> interactive command shell: the file is opened with whatever
> application (if any) its extension is associated. 
> startfile() returns as soon as the associated application is
> launched. There is no option to wait for the application to
> close, and no way to retrieve the application's exit status.
> The path parameter is relative to the current directory. If
> you want to use an absolute path, make sure the first
> character is not a slash ("/"); the underlying Win32
> ShellExecute() function doesn't work if it is. Use the
> os.path.normpath() function to ensure that the path is
> properly encoded for Win32. Availability: Windows. New in
> version 2.0. 
> 
> (c)
> 
> 
> 
> ______________________________________________________________________
> 
> _______________________________________________
> Python mailing list
> Python a lists.python.it
> http://lists.zope.it/cgi-bin/mailman/listinfo/python




More information about the Python mailing list