Skip to content
Snippets Groups Projects
Commit 803d5ea4 authored by Christoph.Knote's avatar Christoph.Knote
Browse files

Write method for output files added.

parent 53b28039
Branches
Tags
No related merge requests found
...@@ -268,6 +268,15 @@ class Output(object): ...@@ -268,6 +268,15 @@ class Output(object):
os.remove(self.fpath) os.remove(self.fpath)
except Exception as e: except Exception as e:
raise("Removing output file did not work: {:s}".format(str(e))) raise("Removing output file did not work: {:s}".format(str(e)))
def write(self, f=sys.stdout):
'''
Write contents of Output into file
:param File f: file object or stream where to write to, defaults to sysout.
'''
with open(self.fpath, 'rb') as i:
for line in i:
f.write(i)
def copy(self, target_path): def copy(self, target_path):
''' '''
Copy output file to target_path Copy output file to target_path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment