[Tutor] How to open file in Excel/Calc spreadsheet?

2006-10-15 Thread Basil Shubin
Hi ,friends!

How I can open Excel or OOCalc spreadsheet file 'remotely' from python 
programm? I mean how to execute Excel or Calc with appropriate 
spreadsheet file?

Thanks in advance!

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to open file in Excel/Calc spreadsheet?

2006-10-15 Thread Kent Johnson
Basil Shubin wrote:
 Hi ,friends!
 
 How I can open Excel or OOCalc spreadsheet file 'remotely' from python 
 programm? I mean how to execute Excel or Calc with appropriate 
 spreadsheet file?

You can use win32com to drive Excel using its COM interface. The sample 
chapter from the O'Reilly book Python Programming on Win32 shows how 
to open a spreadsheet in Excel;
http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html

Google 'python excel com' for more examples.

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to open file in Excel/Calc spreadsheet?

2006-10-15 Thread Paulino




Very simple: os.startfile([file])

ex:
 import os
 os.startfile("d:\\documentos\\eleicoes2005-dn.xls")

It works with any file tipe in windows, the file is opened with it's associated application.




Basil Shubin wrote:
 Hi ,friends!
 
 How I can open Excel or OOCalc spreadsheet file 'remotely' from python 
 programm? I mean how to execute Excel or Calc with appropriate 
 spreadsheet file?




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to open file in Excel/Calc spreadsheet?

2006-10-15 Thread wesley chun
 How I can open Excel or OOCalc spreadsheet file 'remotely' from python
 programm? I mean how to execute Excel or Calc with appropriate
 spreadsheet file?


there was a similar question on the main newsgroup a few days ago,
slightly related to this post, but the answers will be helpful here.

http://groups.google.com/group/comp.lang.python/browse_thread/thread/a7ed60067ca5a8d4/#

if you're interested, i added a section (in chapter 23) to my book,
Core Python Programming, on programming Microsoft Office applications,
with examples for Word, Excel, PowerPoint, and Outlook.

good luck!
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Core Python Programming, Prentice Hall, (c)2007,2001
http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor