Skip to content

Commit

Permalink
api/tools: add append option to DataLog class
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensvalk committed Apr 27, 2020
1 parent ada4552 commit 9ff69a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pybricks/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def reset(self):
class DataLog:
"""Create a file and log data."""

def __init__(self, *headers, name='log', timestamp=True, extension='csv'):
def __init__(self, *headers, name='log', timestamp=True, extension='csv',
append=False):
"""
Arguments:
Expand All @@ -63,6 +64,10 @@ def __init__(self, *headers, name='log', timestamp=True, extension='csv'):
file name. This way, your file has a unique name.
Choose ``False`` to omit the timestamp.
extension (str): File extension.
append (bool): Choose ``True`` to reopen an existing data log file
and append data to it. Choose ``False`` to clear existing
data. If the file does not exist yet, an empty file will be
created either way.
"""
pass

Expand Down

0 comments on commit 9ff69a5

Please sign in to comment.