'Write a file, and force a timestamp difference of at least one second
Notes
Python\'s .pyc files record the timestamp of their compilation
with a time resolution of one second.
Therefore, we need to force a timestamp difference between .py
and .pyc, without having the .py file be timestamped in the
future, and without changing the timestamp of the .pyc file
(because that is stored in the file).  The only reliable way
to achieve this seems to be to sleep.'

def write_file(self, filename, content):

    time.sleep(1.05)
    f = open(filename, 'w')
    try:
        f.write(content)
    finally:
        f.close()
