Q:  If I have a file called "spreadsheet.xls" how can I launch it in what ever program it is associated with?  I don't care if that program is Excel or OpenOffice Calc.  I just want to launch the file.

Since I want to just launch the new process, naturally I looked at os.execl().  However, I can't figure out how to make it work:

>>> import os
>>> os.execl("c:\\spreadsheet.xls")
Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "C:\Python24\lib\os.py", line 309, in execl
    execv(file, args)
OSError: [Errno 8] Exec format error
>>> os.execl("c:\\spreadsheet.xls", "c:\\spreadsheet.xls")
Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "C:\Python24\lib\os.py", line 309, in execl
    execv(file, args)
OSError: [Errno 8] Exec format error

Is there some trick?  I _think_ I'm doing what the docs desribe...

I've tried to Google around and I can't find anything of use.  Having said that, I'd really appreciate it if someone could give me the right 2 word Google search that pops up exactly what I'm looking for. ;->

Thanks!

Chris
--
"A little government and a little luck are necessary in life, but only a fool trusts either of them." -- P. J. O'Rourke
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to