There is a frequent need to track an activity in time. There are many ways to do this, but in general a value and time is kept in a table. pyMeausure has an XML class to help with data storage and manipulation.
# import pyMez
from pyMez import *
new_log=XMLLog()
# we add an entry with add_entry method
new_log.add_entry("I started the log today!")
print(new_log)
style_sheet=os.path.join(TESTS_DIRECTORY,'../XSL/DEFAULT_LOG_STYLE.xsl') #this locates the style sheet
html=new_log.to_HTML(style_sheet)
print(html)
# now the file was autonamed when it was generated
print(new_log.path)
# to save it using this name
new_log.save()
# to save as a different name use new_log.save("NewName.xml")
# to reopen it just intialize the class with its location
path=new_log.path
reopened_log=XMLLog(path)
print(reopened_log)
# to get a python list of dictionaries
new_log.get_table()
# we can also add logs
next_log=XMLLog()
next_log.add_entry("This is another log")
new_log+next_log
print(new_log)
# we can describe the log
new_log.add_description("This log is a test that displays the class")
# to display a formated version in the notebook
from IPython.display import HTML
HTML(new_log.to_HTML(style_sheet))