I found this code on a project, and I do not know what the >>
does. Does anyone have an explanation?
def save(self, fpath=None):
"""
Save the JSON data to fpath. This is done automatically if the
game is over.
"""
if fpath is None:
fpath = _jsonf % self.eid
try:
print >> gzip.open(fpath, 'w+'), self.rawData,
except IOError:
print >> sys.stderr, "Could not cache JSON data. Please " \
"make '%s' writable." \
% os.path.dirname(fpath)
I know that this code is taking information from other files and object within the module, and I know how the code works overall. Only the print >>
is confusing me. When this module is installed in a directory without write access, the message Could not cache...
comes up. The entire file is located here, but I doubt that it will help at all.