Simple question (launch a program)

Jeff Shannon jeff at ccvcorp.com
Mon Jul 2 12:33:53 EDT 2001


Either that, or use double \'s, eg:
>>>os.system("c:\\Program Files\\KeyNote\\keynote.exe")

The likely problem here being that \ indicates escape codes in
python strings; in order to represent \ itself, you either need to
escape it (which is what \\ does), or specify that the string not
use escape codes (which is what the raw string does).

Jeff Shannon
Technician/Programmer
Credit International

Emile van Sebille wrote:

> Maybe you need a raw string? eg:
> >>> system(r"C:\Program Files\KeyNote\keynote.exe")
>
> --
>
> Emile van Sebille
> emile at fenx.com
>
> ---------
> "MDK" <no at spam.com> wrote in message
> news:9hil2h$3qa$1 at taliesin.netcom.net.uk...
> >
> > "Franz GEIGER" <fgeiger at datec.at> wrote in message
> > news:9hf868$941$1 at newsreaderg1.core.theplanet.net...
> > > Did you try os.system()?
> > >
> > > Regards
> > > Franz
> > >
> >
> > Yes. If I do
> > >>> system("notepad")
> > notepad launches and I get a return code of 0.
> >
> > However, if I do:
> > >>> system("C:\Program Files\KeyNote\keynote.exe")
> > I get a return code of 1 and nothing happens.
> >
> >
> >
> >




More information about the Python-list mailing list