On Wed, Aug 5, 2009 at 7:11 AM, John Hunter <jdh2...@gmail.com> wrote:

> >>> import matplotlib.mlab as mlab
> >>> import matplotlib.cbook as cbook
> >>> r = mlab.csv2rec( cbook.get_mpl_data('testdata.csv') )
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/Users/jdhunter/dev/lib/python2.6/site-packages/matplotlib/mlab.py",
> line 2108, in csv2rec
>    fh = cbook.to_filehandle(fname)
>  File
> "/Users/jdhunter/dev/lib/python2.6/site-packages/matplotlib/cbook.py",
> line 339, in to_filehandle
>    raise ValueError('fname must be a string or file handle')
> ValueError: fname must be a string or file handle
>
> Perhaps we could return a plain file handle pointing to the cached data?


Another option is to use StringIO to create a new file-like object after
read()-ing in all the data.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to