Danny and John,
 
Thanks for the pointers.  As I am leaving the project where I need to do this tomorrow, I don't think I will have time to do this, but thanks for the help anyway.
 
David

Danny Yoo <[EMAIL PROTECTED]> wrote:


On Wed, 27 Jul 2005, David Holland wrote:

> I know how to open files in python, however what I want to do is select
> some information from an excel spreadsheet and save it as a .dat file.

Hi David,

Excel spreadsheets are a bit more difficult to work with. They're not
plain text files, but have their own internal binary format, so you'll
probably need a library to deal with them. Many people deal with Excel by
either converting the files to something plain-textish, like the 'csv'
format, or they get Python to talk to Excel directly.

If you can output your excel spreadsheet in 'csv' format, then Python's
'csv' module should be useful:

http://www.python.org/doc/lib/module-csv.html

and doing the selection should just be a matter of skipping enough rows,
in the file, and then paying attention to the part! icular column you want.


But if you want to go another route --- to talk closely with Excel ---
that might take some more involvement, since it's so tightly bound with
Windows programming. The book "Python Programming on Win32" has a
chapter on how to talk to Excel through Python:

http://www.oreilly.com/catalog/pythonwin32/

and if you're interested in this approach, you may want to talk with the
python-win32 folks:

http://mail.python.org/mailman/listinfo/python-win32


Hope this helps!


How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to