ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
[Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()
by Tim Hirzel other posts by this author
Dec 11 2006 3:27PM messages near this date
Re: [Numpy-discussion] Definition of correlation, correlate and so on ? | Re: [Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()
Hi,
Does anyone know how to get fromfile and tofile to work from a 
tempfile.TemporaryFile?  Or if its not possible?

I am getting this:
 > >> import tempfile
 > >> f = tempfile.TemporaryFile()
 > >> f
<open file '<fdopen> ', mode 'w+b' at 0x01EE1728>
 > >> a = numpy.arange(10)
 > >> a.tofile(f)
Traceback (most recent call last):
  File "<input> ", line 1, in ?
IOError: first argument must be a string or open file

thanks!
tim

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thread:
Tim Hirzel
Charles R Harris
Tim Hirzel
Charles R Harris
Tim Hirzel
Christopher Barker
Tim Hirzel
Travis Oliphant
Charles R Harris
Tim Hirzel
Lisandro Dalcin

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved