On 18 November 2010 21:13, gary engstrom <engstrom.g...@gmail.com> wrote:
> Being new to python I was wondering if there is a way to import exel data > into pyrhon matrix/arrays so that I have some data to work with. I know R > uses Rcmdr as an easy interface > for excel data, which helps keep the reader engaged while learning the > language. > > If you want to read/write an Excel format files, have a look at the "xlwt" and the "xlrt" Python modules (probably what Steven was aluding to). See http://www.python-excel.org/ These modules works quite well for reading/generating Excel files (with expectable limitations) from any platform that Python's available on (e.g. including non-Windows) and thus does not require Excel to be available on the machine you're producing the file on. If however you are running on Windows and have Excel installed, you could also consider driving the real Excel via COM automation, which will guarantee you get desired results including formatting, charts etc when generating sheets, and will ensure you have full access to all the functionality Excel exposes via its COM object model. If your requirements is simple enough though then Steven's suggestion to use CSV is probably preferable, e.g. export the data to CSV and then import with the "csv" module in Python. (The KISS principle applies here as elsewhere in programming: "Keep It Small & Simple") HTH, Walter
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor