fnunpickle#
- astropy.io.misc.fnunpickle(fileorname, number=0)[source]#
 Deprecated since version 6.0: Use pickle from standard library, if you must
Unpickle pickled objects from a specified file and return the contents.
Warning
The
picklemodule is not secure. Only unpickle data you trust.- Parameters:
 - fileorname
python:stror python:file-like object The file name or file from which to unpickle objects. If a file object, it should have been opened in binary mode.
- number
python:int If 0, a single object will be returned (the first in the file). If >0, this specifies the number of objects to be unpickled, and a list will be returned with exactly that many objects. If <0, all objects in the file will be unpickled and returned as a list.
- fileorname
 - Returns:
 - contents
objectorpython:list If
numberis 0, this is a individual object - the first one unpickled from the file. Otherwise, it is a list of objects unpickled from the file.
- contents
 - Raises:
 EOFErrorIf
numberis >0 and there are fewer thannumberobjects in the pickled file.