On 10-Nov-05, at 5:01 AM, <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:

>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:pythonmac-sig- 
> [EMAIL PROTECTED] On Behalf Of Kirk Durston
> Sent: Thursday, November 10, 2005 2:00 AM
> To: pythonmac-sig@python.org
> Subject: [Pythonmac-SIG] inputing multi-digit numbers
>
> I’m having a hard time figuring out how to input a list of numbers,  
> each one of which can be 1, 2, or 3 digits in length. First, I  
> select a column in an Excel file, and copy and past it into a Word  
> file. I then save it as a text file.

Wouldn't it be simpler to use Excel to export as CSV and use python's  
csv module to read them in?

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

I don't understand why Word is involved in getting numbers from Excel  
to Python.

Another alternative would be to use the excellent pywin32 tools to  
extract Excel data directly from within Python, using Excel's COM  
interface.

http://sourceforge.net/projects/pywin32/

Excel has other interfaces it exposes besides COM.  Here is a recipe  
from the Python Cookbook to extract tabular data from an Excel file  
using pywin32 and the ADODB interface.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440661

I hope this is helpful.

--Dethe

"the city carries such a cargo of pathos and longing
  that daily life there vaccinates us against revelation"
  -- Pain Not Bread, The Rise and Fall of Human Breath

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to